/* ============================================================
   GOLEX — UI Components
   All component and screen styles.
============================================================ */


.page-hidden * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .loading-fill { animation: none !important; }
  .loading-logo { animation: none !important; opacity: 1; }
  .loading-sub  { animation: none !important; opacity: 1; }
  .chat-empty-icon, .notif-panel-empty-icon { animation: none !important; }
  .notif-unread-dot { animation: none !important; }
  .guild-empty-icon, .guild-typing-dots span,
  .room-member-dot, .typing-dots span,
  .guild-loading > *, .rooms-empty-icon { animation: none !important; }
  .room-card, .post-card, .rec-card, .community-card { animation: none !important; }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes golexLogoReveal {
  0%   { opacity: 0; transform: scale(0.6) translateY(16px); letter-spacing: 24px; }
  50%  { opacity: 0.85; }
  100% { opacity: 1; transform: scale(1) translateY(0); letter-spacing: -0.5px; }
}
@keyframes golexSubReveal {
  0%   { opacity: 0; transform: translateY(10px); letter-spacing: 8px; }
  100% { opacity: 1; transform: translateY(0); letter-spacing: 3px; }
}
@keyframes golexBarReveal {
  0%   { opacity: 0; transform: scaleX(0.4); }
  100% { opacity: 1; transform: scaleX(1); }
}
  100% { opacity: 1; }
}
  100% { opacity: 0.6; transform: translateY(0); }
}
@keyframes orbitPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(35, 87, 232, 0), 0 0 0 0 rgba(5, 150, 105, 0); }
  50%       { box-shadow: 0 0 32px 8px rgba(35, 87, 232, 0.14), 0 0 48px 16px rgba(5, 150, 105, 0.06); }
}
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(35, 87, 232, 0.25); } 50% { box-shadow: 0 0 0 8px rgba(35, 87, 232, 0); } }
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
@keyframes recPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes borderGlow { 0%, 100% { border-color: rgba(35, 87, 232, 0.25); } 50% { border-color: rgba(35, 87, 232, 0.50); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

#msgs-wrap, #notif-list { contain: layout style; }
.msg { contain: layout style; }

#loading-screen { align-items: center; justify-content: center; gap: 24px; }
html[data-authed-hint] #loading-screen { display: none !important; }
.loading-logo {
  font-size: 48px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--accent2));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: golexLogoReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both, shimmer 3s linear 0.4s infinite;
  will-change: transform, opacity;
  transform: translateZ(0);
}
.loading-sub {
  font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 3px; text-transform: uppercase;
  animation: golexSubReveal 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
  will-change: transform, opacity;
}
.loading-track {
  width: 200px; height: 3px; background: rgba(255, 255, 255, 0.06); border-radius: 3px; overflow: hidden; position: relative;
  animation: golexBarReveal 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
  will-change: transform, opacity;
}
.loading-fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 50%;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
  border-radius: 3px; animation: sweep 0.9s ease-in-out infinite;
}

#login-screen { align-items: center; justify-content: center; gap: 14px; text-align: center; }
.login-emblem {
  width: 88px; height: 88px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.10), rgba(79, 70, 229, 0.08));
  border: 1px solid rgba(35, 87, 232, 0.22);
  display: flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 8px;
  box-shadow: 0 0 40px rgba(35, 87, 232, 0.09), inset 0 0 30px rgba(35, 87, 232, 0.10), var(--shadow-lg);
  animation: scaleIn 0.5s var(--ease), floatSlow 4s ease-in-out infinite; overflow: hidden;
}
.login-emblem img { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; }
.login-title { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.login-sub { font-size: 14px; color: var(--muted); max-width: 280px; line-height: 1.6; }
.tagline {
  font-family: var(--font-mono); font-size: 10px; color: rgba(35, 87, 232, 0.68);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px;
  border: 1px solid rgba(35, 87, 232, 0.14); padding: 5px 14px;
  border-radius: var(--radius-pill); background: rgba(35, 87, 232, 0.10);
}

.btn {
  width: 100%; padding: 15px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 700; font-family: var(--font-display);
  cursor: pointer; transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  border: none; letter-spacing: 0.3px; position: relative; overflow: hidden; outline: none;
}
.btn::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity var(--duration-normal); background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent); }
.btn:active::after { opacity: 1; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: white; box-shadow: var(--shadow-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-accent-lg); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 4px 20px var(--glow-accent); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; transform: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); margin-top: 8px; }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); background: rgba(35, 87, 232, 0.10); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-light); border: 1px solid rgba(239, 68, 68, 0.25); margin-top: 8px; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-sm { width: auto; padding: 8px 16px; font-size: 13px; border-radius: var(--radius-xs); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 10px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.input {
  padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px;
  font-family: var(--font-display); outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast); width: 100%;
}
.input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--glow-accent-soft); background: var(--surface); }
.input::placeholder { color: var(--muted-light); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }
select.input { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
select.input option { background: var(--surface); color: var(--text); }
.app-select-popover {
  position: fixed;
  z-index: calc(var(--z-dropdown) + 20);
  min-width: 140px;
  max-height: min(320px, 52dvh);
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
  scrollbar-width: thin;
}
.app-select-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.app-select-option {
  width: 100%;
  border: none;
  border-radius: var(--radius-xs);
  padding: 9px 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-select-option:hover {
  background: rgba(35, 87, 232, 0.08);
  color: var(--text);
}
.app-select-option.selected {
  background: rgba(35, 87, 232, 0.14);
  color: var(--accent);
  font-weight: 700;
}
html[data-theme="dev"] .app-select-popover {
  background: rgba(21, 32, 43, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dev"] .app-select-option:hover {
  background: rgba(29, 155, 240, 0.10);
}
html[data-theme="dev"] .app-select-option.selected {
  background: rgba(29, 155, 240, 0.15);
  color: #60BBEF;
}
textarea.input { resize: none; line-height: 1.5; min-height: 70px; }
.error-text { font-size: 11px; color: var(--danger); display: none; font-family: var(--font-mono); padding-top: 2px; animation: fadeIn var(--duration-fast) var(--ease); }

.skill-select-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.skill-select-pill {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  letter-spacing: 0.1px;
}
.skill-select-pill:hover {
  border-color: rgba(35, 87, 232, 0.45);
  background: rgba(35, 87, 232, 0.06);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(35,87,232,0.12);
  transform: translateY(-1px);
}
.skill-select-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(35, 87, 232, 0.35);
  transform: translateY(-1px);
}

#rooms-screen {
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}
#rooms-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.rooms-top {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 252, 1.0);
}
.rooms-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rooms-top-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.rooms-create-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; border-radius: var(--radius-sm);
  color: white; font-size: 12px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; letter-spacing: 0.3px;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  box-shadow: 0 4px 18px var(--glow-accent);
  white-space: nowrap;
}
.rooms-create-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent-lg); }
.rooms-create-btn:active { transform: translateY(0); }

.rooms-section-label {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
  margin: 0 20px 8px;
  padding-top: 14px;
}

.rooms-list-wrap {
  flex: none;
  overflow: visible;
  padding: 0 0 calc(var(--screen-pb) + 4px);
}

.rooms-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; text-align: center;
  color: var(--muted);
}
.rooms-empty-icon { font-size: 36px; margin-bottom: 4px; opacity: 0.6; }
.rooms-empty-text { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.rooms-empty-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }

.rooms-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 30px 20px;
}

.room-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; margin: 0 12px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  position: relative; overflow: hidden;
  animation: fadeUp var(--duration-slow) var(--ease) both;
  box-shadow: var(--shadow-sm);
}
.room-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.025), transparent);
  pointer-events: none;
}
.room-card:hover {
  border-color: rgba(35, 87, 232, 0.24);
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.room-card:active { transform: translateY(0); }
.room-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.10), rgba(5, 150, 105, 0.07));
  border: 1px solid rgba(35, 87, 232, 0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.room-card-body { flex: 1; min-width: 0; }
.room-card-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.room-card-desc {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.room-card-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px; flex-wrap: wrap;
}
.room-type-pill {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-pill);
}
.room-type-pill.public {
  background: rgba(16,185,129,0.1);
  color: var(--success-light);
  border: 1px solid rgba(16,185,129,0.2);
}
.room-type-pill.private {
  background: rgba(245,158,11,0.1);
  color: var(--warning-light);
  border: 1px solid rgba(245,158,11,0.2);
}
.room-entry-pill {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.07);
  color: var(--accent);
  border: 1px solid rgba(35, 87, 232, 0.14);
}
.room-member-count {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); display: flex; align-items: center; gap: 3px;
  margin-left: auto; flex-shrink: 0;
}
.room-member-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--success); animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

.rooms-my-badge {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.8px;
  padding: 2px 7px; border-radius: var(--radius-pill);
  background: rgba(5, 150, 105, 0.09);
  color: var(--accent2-light);
  border: 1px solid rgba(5, 150, 105, 0.18);
  margin-left: 6px; vertical-align: middle;
}

#room-create-screen {
  display: none;
  flex-direction: column;
  flex: 1; overflow: hidden;
  background: var(--panel);
  width: 100%;
  height: 100%;
}
#room-create-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }
@media (min-width: 1024px) {
  #room-create-screen.active {
    position: absolute;
    inset: 0;
    z-index: 5;
    height: 100dvh;
  }
}

.room-create-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 252, 1.0);
  flex-shrink: 0;
}
.room-create-back {
  background: none; border: none;
  color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: color var(--duration-fast);
  line-height: 1;
}
.room-create-back:hover { color: var(--text); }
.room-create-topbar-title {
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.2px; color: var(--text);
}
.room-create-body {
  flex: 1; overflow-y: auto;
  padding: 24px 20px 100px;
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 87, 232, 0.18) transparent;
}
.room-create-body::-webkit-scrollbar { width: 4px; }
.room-create-body::-webkit-scrollbar-thumb { background: rgba(35, 87, 232, 0.18); border-radius: 2px; }

.room-form-section {
  margin-bottom: 22px;
}
.room-form-label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px; display: block;
}
.room-type-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.room-type-card {
  padding: 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  user-select: none;
}
.room-type-card:hover { border-color: rgba(35, 87, 232, 0.24); }
.room-type-card.selected {
  border-color: rgba(35, 87, 232, 0.42);
  background: rgba(35, 87, 232, 0.14);
  box-shadow: 0 0 16px rgba(35, 87, 232, 0.09);
}
.room-type-card-icon { font-size: 22px; margin-bottom: 6px; }
.room-type-card-name { font-size: 13px; font-weight: 700; color: var(--text); }
.room-type-card-desc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.room-submit-wrap {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 14px 20px 24px;
  background: linear-gradient(to top, rgba(240, 244, 250, 0.98) 70%, transparent);
  z-index: 20;
}
@media (min-width: 1024px) {
  .room-submit-wrap {
    left: 320px;
  }
}

#room-chat-screen {
  display: none;
  flex-direction: column;
  flex: 1; overflow: hidden;
  background: var(--panel);
  width: 100%;
  height: 100%;
  position: relative;
}
#room-chat-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }
@media (min-width: 1024px) {
  #room-chat-screen.active {
    position: absolute;
    inset: 0;
    z-index: 5;
    height: 100dvh;
  }
}

.room-chat-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 252, 0.90);
  flex-shrink: 0;
}
.room-chat-back {
  background: none; border: none;
  color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: color var(--duration-fast);
  line-height: 1;
}
.room-chat-back:hover { color: var(--text); }
.room-chat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.10), rgba(5, 150, 105, 0.07));
  border: 1px solid rgba(35, 87, 232, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.room-chat-info { flex: 1; min-width: 0; }
.room-chat-name {
  font-size: 14px; font-weight: 800;
  color: var(--text); letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-chat-sub {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-chat-actions { display: flex; align-items: center; gap: 6px; }
.room-chat-admin-btn {
  background: none; border: 1px solid var(--border);
  color: var(--muted); font-size: 12px;
  padding: 6px 10px; border-radius: var(--radius-xs);
  cursor: pointer; font-family: var(--font-display);
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.room-chat-admin-btn:hover { border-color: rgba(35, 87, 232, 0.32); color: var(--accent); }

.room-msgs-wrap {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 87, 232, 0.18) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.room-msgs-wrap::-webkit-scrollbar { width: 4px; }
.room-msgs-wrap::-webkit-scrollbar-thumb { background: rgba(35, 87, 232, 0.18); border-radius: 2px; }

.room-date-divider {
  text-align: center;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.5px;
  padding: 8px 0; margin: 4px 0;
  position: relative;
}
.room-date-divider::before, .room-date-divider::after {
  content: '';
  position: absolute; top: 50%;
  width: 30%; height: 1px;
  background: var(--border);
}
.room-date-divider::before { left: 0; }
.room-date-divider::after { right: 0; }

.room-msg-system {
  text-align: center;
  font-size: 11px; color: var(--muted);
  padding: 4px 0; font-style: italic;
}

.room-msg-row {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 80%; margin-bottom: 4px;
}
.room-msg-row.self {
  flex-direction: row-reverse;
  align-self: flex-end;
  margin-left: auto;
}
.room-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.12), rgba(5, 150, 105, 0.08));
  border: 1px solid rgba(35, 87, 232, 0.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--accent-light);
  flex-shrink: 0; overflow: hidden;
}
.room-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.room-msg-content { display: flex; flex-direction: column; gap: 2px; }
.room-msg-sender-name {
  font-size: 10px; font-weight: 700;
  color: var(--accent-light); margin-left: 4px;
  transition: color 0.15s;
  cursor: pointer;
}
.room-msg-sender-name:hover { color: var(--accent-light); }
.room-msg-bubble {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  font-size: 13px; color: var(--text);
  line-height: 1.5; word-break: break-word;
  max-width: 100%;
}
.room-msg-row.self .room-msg-bubble {
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.10), rgba(35, 87, 232, 0.14));
  border-color: rgba(35, 87, 232, 0.22);
  border-radius: 12px 12px 4px 12px;
}
.room-msg-time {
  font-size: 10px; color: var(--muted);
  margin-left: 4px;
}
.room-msg-row.self .room-msg-time { text-align: right; margin-right: 4px; margin-left: 0; }

.room-typing-bar {
  min-height: 18px; padding: 0 16px 2px;
  font-size: 11px; color: var(--muted); font-style: italic;
}

.room-input-area {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--border);
  background: rgba(248, 249, 252, 0.90);
}
.room-input-area .icon-btn {
  width: 40px; height: 40px;
  flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.room-input-wrap {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: border-color var(--duration-fast);
}
.room-input-wrap:focus-within { border-color: var(--border-focus); }
.room-input-wrap textarea {
  width: 100%; background: none; border: none;
  outline: none; color: var(--text);
  font-size: 14px; font-family: var(--font-display);
  resize: none; line-height: 1.5;
  max-height: 120px; overflow-y: auto;
}
.room-input-wrap textarea::placeholder { color: var(--muted); }
.room-send-btn {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; border-radius: var(--radius-sm);
  color: white; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-accent);
}
.room-send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-accent-lg); }
.room-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

#room-admin-panel-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 300;
}
#room-admin-panel-overlay.open { display: block; }
#room-admin-panel {
  position: fixed; top: 0; right: -100%;
  width: min(360px, 100vw); height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 301;
  display: flex; flex-direction: column;
  transition: right 0.3s var(--ease);
  overflow: hidden;
}
#room-admin-panel.open { right: 0; }
.room-admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 252, 0.90);
  flex-shrink: 0;
}
.room-admin-panel-title { font-size: 15px; font-weight: 800; color: var(--text); }
.room-admin-panel-close {
  background: none; border: none;
  color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: color var(--duration-fast);
}
.room-admin-panel-close:hover { color: var(--text); }
.room-admin-panel-body {
  flex: 1; overflow-y: auto; padding: 16px 20px 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 87, 232, 0.18) transparent;
}
.room-admin-section-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin: 14px 0 8px;
}
.room-invite-link-wrap {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.room-invite-link-text {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent-light);
  word-break: break-all; line-height: 1.5;
}
.room-members-list {
  display: flex; flex-direction: column; gap: 6px;
}
.room-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.room-member-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.2), rgba(5, 150, 105, 0.15));
  border: 1px solid rgba(35, 87, 232, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--accent-light);
  overflow: hidden; flex-shrink: 0;
}
.room-member-av img { width: 100%; height: 100%; object-fit: cover; }
.room-member-name { flex: 1; font-size: 12px; font-weight: 600; color: var(--text); }
.room-member-role {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--accent-light); letter-spacing: 0.5px;
}
.room-member-kick-btn {
  background: none; border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger); font-size: 11px;
  padding: 4px 8px; border-radius: var(--radius-xs);
  cursor: pointer; font-family: var(--font-display); font-weight: 600;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.room-member-kick-btn:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); }

.room-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px;
  color: var(--muted); font-size: 13px;
}

#username-screen {
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
}

.onboard-step {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 28px 24px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  animation: fadeUp var(--duration-slow) var(--ease) both;
}
.onboard-step::-webkit-scrollbar { width: 4px; }
.onboard-step::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
.onboard-step.active { display: flex; }

.onboard-progress-bar {
  width: 100%;
  display: flex;
  gap: 5px;
  margin-bottom: 28px;
  flex-shrink: 0;
}
.onboard-progress-segment {
  height: 3px;
  flex: 1;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.4s var(--ease);
  overflow: hidden;
  position: relative;
}
.onboard-progress-segment.done {
  background: var(--accent);
}
.onboard-progress-segment.active-seg {
  background: rgba(35, 87, 232, 0.15);
}
.onboard-progress-segment.active-seg::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 50%;
  background: var(--accent);
  border-radius: 3px;
  animation: sweep 1.6s ease-in-out infinite;
}

.onboard-step-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.onboard-step-label::before {
  content: '';
  width: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}

.onboard-heading {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.onboard-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.onboard-nav {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}
.onboard-nav .btn {
  flex: 1;
}
.onboard-back-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  flex: 0 0 auto !important;
  width: auto !important;
  padding: 14px 20px !important;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  outline: none;
}
.onboard-back-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.onboard-icon {
  font-size: 44px;
  margin-bottom: 16px;
  display: block;
  animation: floatSlow 3s ease-in-out infinite;
}

.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.skill-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  user-select: none;
  text-align: center;
}
.skill-card:hover {
  border-color: rgba(35, 87, 232, 0.4);
  background: rgba(35, 87, 232, 0.07);
  transform: translateY(-2px);
}
.skill-card.selected {
  background: rgba(35, 87, 232, 0.10);
  border-color: rgba(35, 87, 232, 0.45);
  box-shadow: 0 0 16px rgba(35, 87, 232, 0.12);
}
.skill-card-emoji { font-size: 22px; line-height: 1; }
.skill-card-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.skill-card.selected .skill-card-label { color: var(--accent-light); }

.level-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.level-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}
.level-card:hover {
  border-color: rgba(35, 87, 232, 0.35);
  background: rgba(35, 87, 232, 0.14);
  transform: translateX(4px);
}
.level-card.selected {
  background: rgba(35, 87, 232, 0.09);
  border-color: rgba(35, 87, 232, 0.42);
  box-shadow: 0 0 16px rgba(35, 87, 232, 0.10);
}
.level-card-emoji { font-size: 24px; flex-shrink: 0; }
.level-card-info { flex: 1; }
.level-card-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.level-card-desc { font-size: 11px; color: var(--muted); }
.level-card.selected .level-card-name { color: var(--accent-light); }
.level-card-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.level-card.selected .level-card-check {
  background: var(--accent);
  border-color: var(--accent);
}

.onboard-welcome-brand {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--accent2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
  margin-bottom: 6px;
  text-align: center;
}

.setup-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.setup-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.setup-step { font-size: 10px; font-family: var(--font-mono); color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.setup-step::before { content: ''; width: 16px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 2px; }

.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; min-height: 28px; }
.skill-tag { background: rgba(35, 87, 232, 0.08); border: 1px solid rgba(35, 87, 232, 0.20); border-radius: var(--radius-pill); padding: 4px 10px 4px 12px; font-size: 11px; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; cursor: default; animation: scaleIn var(--duration-fast) var(--ease-spring); user-select: none; }
.skill-tag .tag-remove { cursor: pointer; opacity: 0.5; font-size: 10px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); line-height: 1; border-radius: 50%; padding: 1px; }
.skill-tag .tag-remove:hover { opacity: 1; color: var(--danger); }
.tag-input-row { display: flex; gap: 6px; }
.tag-input-row .input { flex: 1; }
.tag-add-btn { background: rgba(35, 87, 232, 0.08); border: 1px solid rgba(35, 87, 232, 0.20); color: var(--accent); padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); white-space: nowrap; flex-shrink: 0; font-family: var(--font-display); font-weight: 700; outline: none; }
.tag-add-btn:hover { background: rgba(35, 87, 232, 0.14); border-color: rgba(35, 87, 232, 0.34); }

.goals-grid, .avail-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.goal-pill, .avail-pill { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 6px 14px; font-size: 11px; color: var(--muted); cursor: pointer; transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease); user-select: none; }
.goal-pill:hover, .avail-pill:hover { border-color: rgba(255, 255, 255, 0.15); }
.goal-pill.selected { background: rgba(5, 150, 105, 0.10); border-color: rgba(5, 150, 105, 0.30); color: var(--accent2-light); }
.avail-pill.selected { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.35); color: var(--success-light); }

#user-list-screen { gap: 0; padding-bottom: calc(var(--screen-pb) + 4px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.30) transparent; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#user-list-screen::-webkit-scrollbar { width: 4px; }
#user-list-screen::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.30); border-radius: 4px; }
html[data-theme="dev"] #user-list-screen { scrollbar-color: rgba(29,155,240,0.15) transparent; }
html[data-theme="dev"] #user-list-screen::-webkit-scrollbar-thumb { background: rgba(29,155,240,0.15); }
.dir-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dir-title { font-size: 22px; font-weight: 800; }
.dir-count { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid rgba(35, 87, 232, 0.55); transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease); box-shadow: 0 0 16px rgba(35, 87, 232, 0.15); flex-shrink: 0; background: var(--surface); }
.avatar-btn:hover { transform: scale(1.1); box-shadow: 0 0 24px rgba(35, 87, 232, 0.30); border-color: var(--accent); }

.dir-top-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.dir-top-bar-row .search-wrap { flex: 1; min-width: 0; margin-bottom: 0; }
.dir-skill-filter { width: 110px; min-width: 80px; flex-shrink: 1; margin: 0 !important; }
.dir-search-combo { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; transition: border-color var(--duration-fast), box-shadow var(--duration-fast); box-shadow: 0 1px 4px rgba(15,23,42,0.06); }
.dir-search-combo:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--glow-accent-soft); }
.dir-search-icon { display: flex; align-items: center; justify-content: center; padding: 0 10px 0 13px; color: var(--muted); flex-shrink: 0; }
.dir-combo-input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--font-display); font-size: 13.5px; color: var(--text); padding: 10px 6px 10px 0; min-width: 0; -webkit-tap-highlight-color: transparent; }
.dir-combo-input::placeholder { color: var(--muted); }
.dir-combo-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.dir-combo-select { border: none; outline: none; background: transparent; font-family: var(--font-display); font-size: 12px; color: var(--text-secondary); padding: 10px 8px 10px 10px; cursor: pointer; flex-shrink: 0; appearance: none; -webkit-appearance: none; width: 120px; max-width: 42%; min-width: 92px; }
.dir-combo-select:focus { color: var(--accent); }
.dir-online-btn { display: flex; align-items: center; gap: 5px; border: none; background: transparent; font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding: 10px 13px 10px 10px; cursor: pointer; flex-shrink: 0; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); letter-spacing: 0.3px; outline: none; white-space: nowrap; }
.dir-online-btn:hover { color: var(--success-light); background: rgba(16,185,129,0.06); }
.dir-online-btn.active { color: var(--success-light); background: rgba(16,185,129,0.08); }
@media (max-width: 460px) {
  .dir-search-combo { overflow: visible; }
  .dir-combo-select { width: 98px; min-width: 86px; max-width: 36%; padding-left: 8px; }
  .dir-online-btn { padding: 10px 9px; }
  .dir-online-btn span { display: none; }
}
.search-wrap { position: relative; margin-bottom: 10px; flex-shrink: 0; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.search-wrap .input { padding-left: 38px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; flex-shrink: 0; }
.filter-row .input { margin: 0; }
.toggle-pill { display: flex; align-items: center; gap: 6px; white-space: nowrap; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; font-size: 12px; color: var(--muted); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); flex-shrink: 0; user-select: none; }
.toggle-pill input { width: 13px; height: 13px; cursor: pointer; accent-color: var(--accent); }
.toggle-pill:has(input:checked) { border-color: rgba(16, 185, 129, 0.4); color: var(--success-light); background: rgba(16, 185, 129, 0.06); }

#profile-completion-banner { background: rgba(245, 158, 11, 0.06); border: 1px solid rgba(245, 158, 11, 0.2); border-radius: var(--radius-sm); padding: 10px 14px; cursor: pointer; color: var(--accent3-light); font-size: 12px; margin-bottom: 12px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); display: none; align-items: center; gap: 8px; }
#profile-completion-banner:hover { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }

#recs-wrap { display: none; margin-bottom: 14px; }
.section-label { font-size: 10px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.recs-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -ms-overflow-style: none; }
.recs-scroll::-webkit-scrollbar { display: none; }
.rec-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; min-width: 120px; flex-shrink: 0; cursor: pointer; text-align: center; transition: color var(--duration-normal) var(--ease), background var(--duration-normal) var(--ease), border-color var(--duration-normal) var(--ease), box-shadow var(--duration-normal) var(--ease), transform var(--duration-normal) var(--ease), opacity var(--duration-normal) var(--ease); box-shadow: var(--shadow-sm); }
.rec-card:hover { background: rgba(35, 87, 232, 0.10); border-color: rgba(35, 87, 232, 0.22); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.rec-name { font-size: 12px; font-weight: 700; color: var(--text); }
.rec-skill { font-size: 10px; color: var(--accent); margin-top: 3px; font-family: var(--font-mono); opacity: 0.72; }

#users-list { flex: none; overflow: visible; padding-right: 2px; }

.section-sep { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; font-size: 10px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.section-sep::before, .section-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.user-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); cursor: pointer; transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease); margin-bottom: 6px; }
.user-item:hover { background: rgba(35, 87, 232, 0.10); border-color: rgba(35, 87, 232, 0.18); transform: translateX(3px); }
.user-item:active { transform: translateX(1px); }
.user-avatar-wrap { position: relative; flex-shrink: 0; cursor: pointer; }
.user-avatar { width: 42px; height: 42px; border-radius: var(--radius-md); overflow: hidden; background: linear-gradient(135deg, rgba(35, 87, 232, 0.15), rgba(79, 70, 229, 0.12)); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: var(--accent); font-family: var(--font-mono); user-select: none; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.status-pip { position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); border: 2.5px solid var(--surface); transition: color var(--duration-normal), background var(--duration-normal), border-color var(--duration-normal), box-shadow var(--duration-normal), transform var(--duration-normal), opacity var(--duration-normal); }
.status-pip.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.user-body { flex: 1; min-width: 0; }
.user-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 3px; }
.user-name { font-size: 14px; font-weight: 700; }
.user-preview { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge { background: var(--accent); color: white; font-size: 10px; font-weight: 700; font-family: var(--font-mono); min-width: 18px; height: 18px; border-radius: 10px; display: none; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; animation: scaleIn var(--duration-fast) var(--ease-spring); }

.badge { font-size: 9px; padding: 2px 8px; border-radius: var(--radius-pill); font-family: var(--font-mono); white-space: nowrap; letter-spacing: 0.3px; display: inline-block; }
.badge-beginner { background: rgba(110, 101, 96, 0.15); color: var(--text-secondary); border: 1px solid rgba(110, 101, 96, 0.25); }
.badge-intermediate { background: rgba(5, 150, 105, 0.08); color: var(--accent2-light); border: 1px solid rgba(5, 150, 105, 0.22); }
.badge-advanced { background: rgba(35, 87, 232, 0.09); color: var(--accent); border: 1px solid rgba(35, 87, 232, 0.22); }
.badge-professional { background: rgba(245, 158, 11, 0.12); color: var(--accent3-light); border: 1px solid rgba(245, 158, 11, 0.3); }
.rep { font-size: 10px; color: var(--accent3-light); font-family: var(--font-mono); }
.meta-chips { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; flex-wrap: wrap; }
.meta-chips .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.meta-chips .rep { flex-shrink: 0; }
.chat-partner-name .meta-chips { flex-wrap: nowrap; max-width: 100%; }

#chat-screen { padding: 0; gap: 0; position: relative; animation: none !important; }
.chat-topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.99); flex-shrink: 0; position: relative; z-index: 2; will-change: transform; }
.back-btn { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text); font-size: 15px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); flex-shrink: 0; line-height: 1; outline: none; }
.back-btn:hover { background: rgba(35, 87, 232, 0.07); border-color: var(--border-hover); }
.chat-partner-info { flex: 1; min-width: 0; }
.chat-partner-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; cursor: pointer; transition: color 0.15s; }
.chat-partner-name:hover { color: var(--accent-light); }
.chat-partner-status { font-size: 11px; font-family: var(--font-mono); margin-top: 2px; }
.chat-partner-status.online { color: var(--success); }
.chat-partner-status.offline { color: var(--muted); }
.chat-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; color: var(--muted); font-size: 14px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); line-height: 1; outline: none; }
.icon-btn:hover { border-color: var(--border-hover); color: var(--text); background: rgba(35, 87, 232, 0.14); }

.chat-topbar .user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-md); }

#user-info-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 260px; max-width: 75%;
  background: rgba(20, 18, 16, 0.97);
  -webkit-border-left: 1px solid var(--border);
  z-index: 40;
  display: none; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  will-change: transform, opacity;
  contain: layout style;
}
#user-info-panel.open { display: flex; animation: slideInRight 0.3s var(--ease) both; }
#user-info-panel.closing { animation: slideOutRight 0.25s var(--ease) both; }
.info-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(20, 18, 16, 0.95);
  z-index: 2;
}
.info-panel-header span { font-size: 14px; font-weight: 700; }
.info-panel-close {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 5px 10px; color: var(--muted);
  cursor: pointer; font-size: 12px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none; font-family: var(--font-display);
}
.info-panel-close:hover { border-color: var(--border-hover); color: var(--text); }
.info-panel-body { padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.info-panel-avatar {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.25), rgba(5, 150, 105, 0.25));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono); margin: 0 auto;
  border: 2px solid rgba(35, 87, 232, 0.3);
  overflow: hidden;
}
.info-panel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.info-panel-username { text-align: center; font-size: 16px; font-weight: 700; }
.info-panel-stats { display: flex; flex-direction: column; gap: 8px; }
.info-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.info-stat-label { font-size: 11px; font-family: var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.info-stat-value { font-size: 15px; font-weight: 800; color: var(--accent); font-family: var(--font-mono); }
.info-stat-value.level-val { color: var(--accent2-light); }
.info-stat-value.chats-val { color: var(--success-light); }

#pin-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: rgba(245, 158, 11, 0.04); font-size: 12px; color: var(--accent3-light); cursor: pointer; flex-shrink: 0; transition: background var(--duration-fast), max-height 130ms var(--ease), opacity 100ms var(--ease); max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; }
#pin-bar.active { max-height: 44px; opacity: 1; pointer-events: auto; }
#pin-bar:hover { background: rgba(245, 158, 11, 0.08); }
#pin-bar span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pin-bar .unpin-btn { background: none; border: 1px solid rgba(245,158,11,0.25); border-radius: var(--radius-xs); color: var(--accent3-light); cursor: pointer; font-size: 10px; padding: 3px 8px; font-family: var(--font-mono); transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none; flex-shrink: 0; }
#pin-bar .unpin-btn:hover { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.5); }

#chat-search-bar { display: flex; padding: 8px 14px; border-bottom: 1px solid var(--border); background: rgba(248, 249, 252, 0.9); flex-shrink: 0; max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height 150ms var(--ease), opacity 120ms var(--ease); }
#chat-search-bar.active { max-height: 56px; opacity: 1; pointer-events: auto; }
#chat-search-bar .input { font-size: 13px; padding: 8px 12px; }

#msgs-wrap { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 16px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.07) transparent; overscroll-behavior: contain; }
#msgs-wrap::-webkit-scrollbar { width: 4px; }
#msgs-wrap::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 4px; }

.msg { max-width: 82%; display: flex; flex-direction: column; animation: msgIn var(--duration-normal) var(--ease) both; }
.msg.sent { align-self: flex-end; align-items: flex-end; }
.msg.received { align-self: flex-start; align-items: flex-start; }

.msg-reply-ctx { font-size: 11px; color: var(--muted); font-family: var(--font-mono); padding: 5px 10px; border-radius: 8px 8px 0 0; margin-bottom: -4px; border-left: 2px solid var(--accent); background: rgba(35, 87, 232, 0.15); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: background var(--duration-fast); }
.msg-reply-ctx:hover { background: rgba(35, 87, 232, 0.09); }

.msg-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; word-break: break-word; position: relative; cursor: default; transition: background var(--duration-fast); }
.msg-bubble:hover .msg-actions { opacity: 1; pointer-events: all; }
.msg.sent .msg-bubble { background: linear-gradient(145deg, var(--accent), var(--accent-dark)); color: white; border-bottom-right-radius: 4px; box-shadow: 0 3px 14px rgba(35, 87, 232, 0.20); }
.msg.received .msg-bubble { background: rgba(255, 255, 255, 0.05); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-bubble.edited::after { content: ' (edited)'; font-size: 10px; opacity: 0.45; font-family: var(--font-mono); }
.msg-bubble a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 2px; transition: text-decoration-color var(--duration-fast); }
.msg-bubble a:hover { text-decoration-color: rgba(255, 255, 255, 0.7); }
.msg.received .msg-bubble a { text-decoration-color: rgba(35, 87, 232, 0.45); }
.msg.received .msg-bubble a:hover { text-decoration-color: rgba(35, 87, 232, 0.75); }

.msg-actions { position: absolute; top: -40px; opacity: 0; pointer-events: none; background: var(--panel-solid); border: 1px solid var(--border-hover); border-radius: var(--radius-md); padding: 4px; display: flex; gap: 2px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15); z-index: 20; transition: opacity var(--duration-fast); }
.msg.sent .msg-actions { right: 0; }
.msg.received .msg-actions { left: 0; }
.msg-action-btn { background: none; border: none; cursor: pointer; padding: 5px 7px; border-radius: var(--radius-xs); font-size: 13px; color: var(--muted); transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); line-height: 1; outline: none; }
.msg-action-btn:hover { background: rgba(35, 87, 232, 0.08); color: var(--text); }

.msg-reactions { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.reaction-chip { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 14px; padding: 2px 8px; font-size: 12px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); display: flex; align-items: center; gap: 3px; user-select: none; }
.reaction-chip:hover, .reaction-chip.mine { background: rgba(35, 87, 232, 0.09); border-color: rgba(35, 87, 232, 0.28); }
.reaction-chip .rc-count { font-size: 10px; font-family: var(--font-mono); color: var(--muted); }

.msg-meta { font-size: 10px; font-family: var(--font-mono); margin-top: 4px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; opacity: 0.85; }
.msg.sent .msg-meta { color: rgba(255, 255, 255, 0.8); }
.msg.received .msg-meta { color: var(--muted); }
.msg.sent .msg-seen { color: var(--accent2-light); font-weight: bold; }
.msg.received .msg-seen { color: var(--accent2); }

.msg-img-wrap { position: relative; border-radius: var(--radius-md); overflow: hidden; max-width: 220px; cursor: pointer; }
.msg-img { width: 100%; max-height: 220px; object-fit: cover; display: block; border-radius: var(--radius-md); transition: transform var(--duration-normal); }
.msg-img-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--duration-fast); border-radius: var(--radius-md); }
.msg-img-wrap:hover .msg-img-overlay { opacity: 1; }
.msg-img-wrap:hover .msg-img { transform: scale(1.03); }
.msg-img-overlay span { font-size: 24px; }

.msg-file-bubble { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); min-width: 180px; }
.msg-file-bubble:hover { border-color: var(--border-hover); background: rgba(35, 87, 232, 0.10); }
.msg-file-icon { font-size: 24px; flex-shrink: 0; }
.msg-file-info { flex: 1; min-width: 0; }
.msg-file-name { font-size: 12px; font-family: var(--font-mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.msg-file-meta { font-size: 10px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.msg-file-dl { font-size: 10px; color: var(--accent2); cursor: pointer; transition: color var(--duration-fast); }
.msg-file-dl:hover { text-decoration: underline; color: var(--accent2-light); }

.msg-audio { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 200px; }
.msg.sent .msg-audio { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.12); }
.audio-play-btn { background: var(--accent); border: none; border-radius: 50%; width: 34px; height: 34px; cursor: pointer; color: white; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform var(--duration-fast), background var(--duration-fast); box-shadow: var(--shadow-accent); outline: none; }
.audio-play-btn:hover { transform: scale(1.1); background: var(--accent-dark); }
.audio-play-btn.playing { background: var(--accent2); }
.audio-info { flex: 1; min-width: 0; }
.audio-wave { display: flex; align-items: center; gap: 2px; height: 24px; }
.audio-wave-bar { width: 3px; border-radius: 2px; transition: background var(--duration-fast); }
.audio-duration { font-size: 10px; font-family: var(--font-mono); color: var(--muted); margin-top: 2px; }
.msg.sent .audio-duration { color: rgba(255, 255, 255, 0.5); }

.upload-spinner { width: 22px; height: 22px; border: 2px solid rgba(35, 87, 232, 0.12); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; will-change: transform; }

.date-sep { text-align: center; font-size: 10px; font-family: var(--font-mono); color: var(--muted); align-self: center; background: rgba(255, 255, 255, 0.05); padding: 4px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); margin: 8px 0; user-select: none; }

#typing-bar { height: 22px; padding: 0 16px; font-size: 11px; font-family: var(--font-mono); color: var(--muted); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.typing-dots { opacity: 0; transition: opacity 150ms var(--ease); pointer-events: none; display: inline-flex; align-items: center; }
.typing-dots.active { opacity: 1; pointer-events: auto; }
.typing-dots span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin: 0 1px; animation: bounce 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
.typing-label { opacity: 0; transition: opacity 150ms var(--ease); font-size: 11px; }

#reply-preview { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--border); background: rgba(35, 87, 232, 0.03); flex-shrink: 0; font-size: 12px; max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height 130ms var(--ease), opacity 100ms var(--ease); }
#reply-preview.active { max-height: 52px; opacity: 1; pointer-events: auto; }
#reply-preview-text { flex: 1; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#reply-cancel, #edit-cancel { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 4px; transition: color var(--duration-fast); line-height: 1; outline: none; }
#reply-cancel:hover, #edit-cancel:hover { color: var(--danger); }
#edit-bar { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--border); background: rgba(245, 158, 11, 0.04); flex-shrink: 0; font-size: 12px; max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height 130ms var(--ease), opacity 100ms var(--ease); }
#edit-bar.active { max-height: 44px; opacity: 1; pointer-events: auto; }
#edit-bar-text { flex: 1; color: var(--accent3-light); font-family: var(--font-mono); }

#starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; flex-shrink: 0; max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height 130ms var(--ease), opacity 100ms var(--ease); }
#starters.active { max-height: 80px; opacity: 1; pointer-events: auto; }
.starter { background: rgba(35, 87, 232, 0.14); border: 1px solid rgba(35, 87, 232, 0.16); border-radius: var(--radius-pill); padding: 7px 16px; font-size: 12px; color: var(--accent); cursor: pointer; transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease); }
.starter:hover { background: rgba(35, 87, 232, 0.11); border-color: rgba(35, 87, 232, 0.32); transform: translateY(-1px); }

.chat-input-area { padding: 8px 14px 12px; border-top: 1px solid var(--border); display: flex; gap: 6px; align-items: flex-end; flex-shrink: 0; background: rgba(255, 255, 255, 0.99); }
.attach-wrap { position: relative; flex-shrink: 0; }
.chat-attach-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 38px; height: 38px; color: var(--muted); font-size: 16px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast); display: flex; align-items: center; justify-content: center; line-height: 1; outline: none; }
.chat-attach-btn:hover { border-color: var(--border-hover); color: var(--text); background: rgba(35, 87, 232, 0.15); }
.attach-menu { position: absolute; bottom: 46px; left: 0; background: var(--panel-solid); border: 1px solid var(--border-hover); border-radius: 14px; padding: 6px; flex-direction: column; gap: 2px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18); z-index: var(--z-dropdown); min-width: 160px; display: flex; opacity: 0; visibility: hidden; pointer-events: none; transform: scale(0.95) translateY(4px); transform-origin: bottom left; transition: opacity 120ms var(--ease), transform 120ms var(--ease), visibility 0ms 125ms; }
.attach-menu.open { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1) translateY(0); transition: opacity 120ms var(--ease), transform 120ms var(--ease), visibility 0ms 0ms; }
.attach-opt { background: none; border: none; color: var(--text-secondary); font-size: 13px; font-family: var(--font-display); padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; transition: color var(--duration-fast), background var(--duration-fast); white-space: nowrap; outline: none; }
.attach-opt:hover { background: rgba(35, 87, 232, 0.07); }
.attach-opt span { font-size: 16px; }

.voice-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 38px; height: 38px; color: var(--muted); font-size: 16px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; outline: none; }
.voice-btn:hover { border-color: rgba(239, 68, 68, 0.3); color: var(--danger-light); background: rgba(239, 68, 68, 0.06); }
.voice-btn.recording { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.1); animation: recPulse 1s ease infinite; }

.chat-input-wrap { flex: 1; position: relative; }
.chat-input-area .input { flex: 1; font-size: 14px; padding: 10px 12px; max-height: 120px; overflow-y: auto; resize: none; width: 100%; border-radius: var(--radius-md); }

.send-btn { width: 38px; height: 38px; border-radius: var(--radius-md); flex-shrink: 0; background: linear-gradient(145deg, var(--accent), var(--accent-dark)); border: none; cursor: pointer; color: white; font-size: 16px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-accent); line-height: 1; outline: none; }
.send-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-accent-lg); }
.send-btn:active { transform: scale(0.96); }
.send-btn:disabled { opacity: 0.35; pointer-events: none; transform: none; }

#recording-bar { display: none; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid rgba(239, 68, 68, 0.15); background: rgba(239, 68, 68, 0.03); flex-shrink: 0; }
#recording-bar.active { display: flex; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: recPulse 1s ease infinite; }
.rec-timer { font-size: 13px; font-family: var(--font-mono); color: var(--danger-light); }
.rec-label { font-size: 12px; color: var(--muted); flex: 1; }
.rec-cancel { background: none; border: 1px solid rgba(239, 68, 68, 0.25); border-radius: var(--radius-xs); color: var(--danger-light); cursor: pointer; font-size: 11px; padding: 4px 12px; font-family: var(--font-mono); transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none; }
.rec-cancel:hover { background: rgba(239, 68, 68, 0.12); }

#img-preview-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border); background: rgba(248, 249, 252, 0.95); flex-shrink: 0; max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height 140ms var(--ease), opacity 100ms var(--ease); }
#img-preview-bar.active { max-height: 72px; opacity: 1; pointer-events: auto; }
.preview-thumb { width: 54px; height: 54px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); background: var(--surface); }
.preview-info { flex: 1; min-width: 0; }
.preview-name { font-size: 12px; font-family: var(--font-mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-size { font-size: 10px; color: var(--muted); margin-top: 2px; }
.preview-cancel { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 2px 4px; transition: color var(--duration-fast); line-height: 1; outline: none; }
.preview-cancel:hover { color: var(--danger); }
.preview-send { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border: none; color: white; cursor: pointer; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 13px; font-family: var(--font-display); font-weight: 700; transition: opacity var(--duration-fast); outline: none; }
.preview-send:hover { opacity: 0.9; }
.preview-send:disabled { opacity: 0.4; pointer-events: none; }

#reaction-picker { position: absolute; z-index: var(--z-modal); background: var(--panel-solid); border: 1px solid var(--border-hover); border-radius: 14px; padding: 8px 10px; display: none; gap: 6px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18); font-size: 20px; }
#reaction-picker.open { display: flex; animation: scaleIn var(--duration-fast) var(--ease); }
#reaction-picker span { cursor: pointer; transition: transform var(--duration-fast); padding: 2px; border-radius: var(--radius-xs); line-height: 1; user-select: none; color: var(--text); }
#reaction-picker span:hover { transform: scale(1.35); background: rgba(35, 87, 232, 0.08); }

#lightbox { position: absolute; inset: 0; z-index: var(--z-lightbox); background: rgba(0, 0, 0, 0.97); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
#lightbox.open { display: flex; animation: fadeIn var(--duration-fast) var(--ease); }
#lightbox img { max-width: 92%; max-height: 80%; border-radius: var(--radius-md); object-fit: contain; }
.lightbox-toolbar { display: flex; gap: 8px; }
#lightbox-close { background: rgba(255, 255, 255, 0.08); border: none; color: white; font-size: 14px; cursor: pointer; border-radius: var(--radius-sm); padding: 8px 16px; font-family: var(--font-mono); transition: background var(--duration-fast); outline: none; }
#lightbox-close:hover { background: rgba(255, 255, 255, 0.15); }
#lightbox-download { background: rgba(35, 87, 232, 0.15); border: 1px solid rgba(35, 87, 232, 0.30); color: white; font-size: 14px; cursor: pointer; border-radius: var(--radius-sm); padding: 8px 16px; font-family: var(--font-mono); transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none; }
#lightbox-download:hover { background: rgba(35, 87, 232, 0.28); }

#drop-overlay { position: absolute; inset: 0; z-index: 60; background: rgba(35, 87, 232, 0.12); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 8px; border: 3px dashed rgba(35, 87, 232, 0.35); border-radius: var(--radius-xl); pointer-events: none; }
#drop-overlay.active { display: flex; animation: fadeIn var(--duration-fast) var(--ease); }
#drop-overlay .drop-icon { font-size: 48px; opacity: 0.7; }
#drop-overlay .drop-text { font-size: 16px; font-weight: 700; color: var(--accent); }

#profile-modal { position: absolute; inset: 0; z-index: var(--z-modal); background: rgba(248, 249, 252, 1.0); display: flex; flex-direction: column; padding: 0; transform: translateY(100%); transition: transform var(--duration-slow) var(--ease), visibility 0ms calc(var(--duration-slow) + 10ms); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(35, 87, 232, 0.12) transparent; will-change: transform; visibility: hidden; pointer-events: none; }
#profile-modal.open { transform: translateY(0); transition: transform var(--duration-slow) var(--ease), visibility 0ms 0ms; visibility: visible; pointer-events: auto; }
#profile-modal::-webkit-scrollbar { width: 4px; }
#profile-modal::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
.modal-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; position: sticky; top: 0; background: rgba(248, 249, 252, 1.0); z-index: 2; }
.modal-topbar-title { font-size: 16px; font-weight: 800; }
.modal-close { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 14px; color: var(--muted); cursor: pointer; font-size: 13px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); font-family: var(--font-display); outline: none; }
.modal-close:hover { border-color: var(--border-hover); color: var(--text); }
.modal-body { padding: 20px 20px 32px; display: flex; flex-direction: column; }
.modal-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 20px; position: relative; }
.modal-avatar { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; border: 2px solid var(--accent); box-shadow: var(--shadow-md); background: var(--surface); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); }
.modal-avatar:hover { transform: scale(1.05); box-shadow: var(--shadow-accent-lg); }
.pfp-change-label { font-size: 10px; font-family: var(--font-mono); color: var(--accent-light); cursor: pointer; transition: color var(--duration-fast); text-decoration: underline; text-underline-offset: 2px; }
.pfp-change-label:hover { color: var(--accent); }
.pfp-change-label.disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.pfp-cooldown-text { font-size: 10px; font-family: var(--font-mono); color: var(--accent3-light); text-align: center; }
.modal-email-text { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.stats-row { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.stats-row::-webkit-scrollbar { display: none; }
.stat-chip { flex: 1; min-width: 0; background: rgba(35, 87, 232, 0.10); border: 1px solid rgba(35, 87, 232, 0.10); border-radius: var(--radius-sm); padding: 8px 6px; text-align: center; }
.stat-val { font-size: 16px; font-weight: 800; color: var(--accent); font-family: var(--font-mono); }
.stat-lbl { font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 36px; opacity: 0.35; }
.empty-text { font-size: 14px; }
.empty-sub { font-size: 12px; font-family: var(--font-mono); opacity: 0.5; }

.msg-expiry-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-family: var(--font-mono); letter-spacing: 0.3px; padding: 1px 6px; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1.3; }
.msg-expiry-badge.expiry-safe { color: var(--muted); background: rgba(110, 101, 96, 0.1); border: 1px solid rgba(110, 101, 96, 0.15); }
.msg-expiry-badge.expiry-warning { color: var(--accent3-light); background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); }
.msg-expiry-badge.expiry-critical { color: var(--danger-light); background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); animation: pulseGlow 2s ease-in-out infinite; }

.msg-expired-placeholder { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--radius-md); border: 1px dashed rgba(110, 101, 96, 0.3); background: rgba(110, 101, 96, 0.04); color: var(--muted); font-size: 12px; font-family: var(--font-mono); min-width: 180px; }
.msg-expired-placeholder .expired-icon { font-size: 20px; opacity: 0.5; }
.msg-expired-placeholder .expired-text { flex: 1; }
.msg-expired-placeholder .expired-label { color: var(--muted); font-size: 12px; }
.msg-expired-placeholder .expired-sub { font-size: 10px; color: rgba(110, 101, 96, 0.6); margin-top: 2px; }

#cleanup-status { display: none; align-items: center; justify-content: center; gap: 6px; padding: 5px 14px; background: rgba(35, 87, 232, 0.10); border-bottom: 1px solid rgba(35, 87, 232, 0.10); font-size: 10px; font-family: var(--font-mono); color: var(--accent); flex-shrink: 0; animation: fadeIn var(--duration-fast) var(--ease); }
#cleanup-status.visible { display: flex; }

#toast { position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(20, 18, 16, 0.99); border: 1px solid var(--border-hover); color: rgba(255, 255, 255, 0.92); font-size: 13px; padding: 10px 20px; border-radius: 24px; opacity: 0; transition: color var(--duration-normal) var(--ease), background var(--duration-normal) var(--ease), border-color var(--duration-normal) var(--ease), box-shadow var(--duration-normal) var(--ease), transform var(--duration-normal) var(--ease), opacity var(--duration-normal) var(--ease); pointer-events: none; white-space: nowrap; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5); z-index: var(--z-toast); font-family: var(--font-mono); max-width: min(360px, calc(100vw - 32px)); will-change: transform, opacity; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: rgba(239, 68, 68, 0.4); color: var(--danger-light); }
#toast.success { border-color: rgba(16, 185, 129, 0.4); color: var(--success-light); }

#scroll-bottom-btn {
  position: absolute; bottom: calc(var(--nav-h) + 8px); right: 16px; background: var(--accent); border: none; width: 40px; height: 40px; border-radius: 40px; color: white; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-accent); transition: transform 0.2s ease, opacity 0.18s ease; z-index: 35; opacity: 0; pointer-events: none; will-change: opacity, transform;
}
#scroll-bottom-btn.visible { opacity: 1; pointer-events: auto; }
#scroll-bottom-btn:hover { transform: scale(1.05); background: var(--accent); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
.hidden-input { display: none; }
.msg-highlight .msg-bubble { outline: 2px solid var(--accent2); outline-offset: 2px; transition: outline var(--duration-normal); }

#call-overlay {
  position: absolute; inset: 0; z-index: 90;
  background: rgba(248, 249, 252, 0.97);
  -webkit-display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  will-change: opacity;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.22s var(--ease), visibility 0ms 230ms;
}
#call-overlay.active { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity 0.22s var(--ease), visibility 0ms 0ms; }

.call-card {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  padding: 40px 32px; width: 100%;
}

.call-avatar {
  width: 96px; height: 96px; border-radius: 28px;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.3), rgba(5, 150, 105, 0.3));
  border: 2px solid rgba(35, 87, 232, 0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono);
  box-shadow: 0 0 40px rgba(35, 87, 232, 0.2);
  animation: pulseGlow 2s ease-in-out infinite;
  overflow: hidden;
}
.call-avatar img { width: 100%; height: 100%; object-fit: cover; }

.call-name {
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.3px;
}

.call-status {
  font-size: 13px; font-family: var(--font-mono);
  color: var(--text-secondary); letter-spacing: 0.5px;
}

.call-timer {
  font-size: 28px; font-weight: 800;
  font-family: var(--font-mono); color: var(--success);
  letter-spacing: 2px;
}

.call-controls { margin-top: 24px; }

.call-end-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--danger-light);
  padding: 14px 36px;
  border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.call-end-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  transform: scale(1.04);
}

#incoming-call-banner {
  position: absolute; top: 60px; left: 16px; right: 16px;
  z-index: 95;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: none; align-items: center; justify-content: space-between;
  gap: 12px;
  -webkit-box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeInDown 0.3s var(--ease);
  will-change: transform, opacity;
}
#incoming-call-banner.active { display: flex; }

.incoming-info { display: flex; align-items: center; gap: 10px; }
.incoming-icon { font-size: 24px; animation: bounce 1s ease-in-out infinite; }
.incoming-name { font-size: 14px; font-weight: 700; color: var(--text); }
.incoming-sub { font-size: 11px; font-family: var(--font-mono); color: var(--success-light); }

.incoming-actions { display: flex; gap: 10px; flex-shrink: 0; }

.incoming-accept-btn {
  background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-pill); padding: 8px 16px;
  font-size: 18px; cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.incoming-accept-btn:hover { background: rgba(16, 185, 129, 0.35); transform: scale(1.1); }

.incoming-reject-btn {
  background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-pill); padding: 8px 16px;
  font-size: 18px; cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.incoming-reject-btn:hover { background: rgba(239, 68, 68, 0.3); transform: scale(1.1); }

#call-video-area {
  position: absolute;
  inset: 0;
  display: none;
  background: #000;
  z-index: 0;
}
#call-video-area.active { display: block; }

#remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

#self-video {
  position: absolute;
  bottom: 160px;
  right: 16px;
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(35, 87, 232, 0.6);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 10;
  background: #111;
  cursor: pointer;
}

#call-overlay.video-active .call-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
  padding: 20px 32px 32px;
  gap: 12px;
}

#call-overlay.video-active .call-avatar,
#call-overlay.video-active .call-name,
#call-overlay.video-active .call-status {
  display: none;
}

#call-overlay.video-active .call-timer {
  font-size: 20px;
  margin-bottom: 0;
}

.call-controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.call-video-btn {
  background: rgba(35, 87, 232, 0.15);
  border: 1px solid rgba(35, 87, 232, 0.4);
  color: var(--accent-light);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.call-video-btn:hover {
  background: rgba(35, 87, 232, 0.3);
  border-color: rgba(35, 87, 232, 0.65);
  transform: scale(1.04);
}
.call-video-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.call-camera-btn {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: var(--accent2-light);
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: none;
}
.call-camera-btn.visible { display: inline-flex; align-items: center; gap: 6px; }
.call-camera-btn:hover {
  background: rgba(5, 150, 105, 0.2);
  border-color: rgba(5, 150, 105, 0.5);
}

#video-switch-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: rgba(20, 18, 16, 0.97);
  border: 1px solid rgba(35, 87, 232, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  min-width: 280px;
  max-width: 90%;
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(35, 87, 232, 0.1);
  animation: scaleIn 0.25s var(--ease-spring);
}
#video-switch-popup.active { display: flex; }

.video-popup-icon { font-size: 36px; }
.video-popup-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.video-popup-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.video-popup-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.video-popup-accept {
  flex: 1;
  padding: 11px 16px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: var(--success-light);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.video-popup-accept:hover {
  background: rgba(16, 185, 129, 0.35);
  transform: scale(1.03);
}
.video-popup-deny {
  flex: 1;
  padding: 11px 16px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--danger-light);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.video-popup-deny:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: scale(1.03);
}

.call-sketch-btn {
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: #7c3aed;
}
.call-sketch-btn:hover {
  background: rgba(124, 58, 237, 0.24);
  border-color: rgba(124, 58, 237, 0.55);
}

#sketch-board-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(15, 23, 35, 0.72);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
#sketch-board-overlay.active { display: flex; }
.sketch-board-shell {
  width: min(1040px, 100%);
  height: min(760px, calc(100vh - 36px));
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(249,251,255,0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  box-shadow: 0 26px 60px rgba(3, 7, 18, 0.32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sketch-board-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.7);
}
.sketch-board-title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  font-family: var(--font-display);
  letter-spacing: 0.2px;
  padding-top: 6px;
  white-space: nowrap;
}
.sketch-board-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.sketch-tool-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.sketch-tool-btn:hover {
  border-color: rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.sketch-tool-btn.active {
  border-color: rgba(35, 87, 232, 0.45);
  color: #1d4ed8;
  background: rgba(35, 87, 232, 0.1);
  box-shadow: inset 0 0 0 1px rgba(35, 87, 232, 0.12);
}
.sketch-tool-btn.danger {
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}
.sketch-tool-btn.danger:hover {
  border-color: rgba(239, 68, 68, 0.45);
  color: #b91c1c;
}
.sketch-inline-field {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.92);
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-display);
  font-weight: 700;
}
.sketch-inline-field input[type="color"] {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}
.sketch-inline-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sketch-inline-field input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}
.sketch-inline-field input[type="range"] {
  width: 112px;
  accent-color: #3b82f6;
}
#sketch-board-canvas {
  flex: 1;
  width: 100%;
  background:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.16) 1px, transparent 0) 0 0 / 24px 24px,
    #ffffff;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  touch-action: none;
  cursor: crosshair;
}
.sketch-zoom-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  padding: 0 6px;
  min-width: 40px;
  text-align: center;
  line-height: 36px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  user-select: none;
  pointer-events: none;
}
.sketch-tool-btn.sketch-zoom-btn {
  padding: 0 10px;
  font-size: 15px;
  min-width: 36px;
}
#sketch-board-canvas.sketch-panning { cursor: grab !important; }
#sketch-board-canvas.sketch-panning.sketch-grabbing { cursor: grabbing !important; }
@media (max-width: 880px) {
  .sketch-board-shell {
    width: 100%;
    height: calc(100vh - 20px);
    border-radius: 16px;
  }
  .sketch-board-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .sketch-board-title {
    padding-top: 0;
  }
  .sketch-board-tools {
    justify-content: flex-start;
    gap: 8px;
  }
}
#main-nav {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 6px 8px;
  padding-bottom: calc(6px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(248, 249, 252, 0.92);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  isolation: isolate;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#main-nav::-webkit-scrollbar { display: none; }
#main-nav.visible { display: flex; }
.nav-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 10px; border: none; background: none;
  cursor: pointer; border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  color: var(--muted); min-width: 52px; flex-shrink: 0;
  outline: none; -webkit-tap-highlight-color: transparent;
}
.nav-btn .nav-icon { font-size: 20px; line-height: 1; transition: transform var(--duration-fast) var(--ease-spring); }
.nav-btn .nav-label { font-size: 9px; font-family: var(--font-mono); letter-spacing: 0.5px; text-transform: uppercase; transition: color var(--duration-fast); display: none; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon { transform: translateY(-2px); }
.nav-btn:hover { color: var(--text); background: rgba(35, 87, 232, 0.07); }
.nav-btn.create-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white; border-radius: var(--radius-md);
  box-shadow: 0 4px 16px var(--glow-accent);
  padding: 8px 16px; margin: -2px 0;
}
.nav-btn.create-btn .nav-label { color: rgba(255,255,255,0.8); }
.nav-btn.create-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(35, 87, 232, 0.45); }
.nav-btn.create-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: white; }

#guild-screen {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
#guild-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.guild-header {
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 252, 0.90);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.guild-header::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 0 2px 2px 0;
}
.guild-header-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.guild-header-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.guild-header-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent2-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  white-space: nowrap;
}
.guild-header-sub {
  display: none;
}
.guild-member-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  flex-shrink: 0;
}
.guild-member-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

#guild-msgs-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#guild-msgs-wrap::-webkit-scrollbar { width: 3px; }
#guild-msgs-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.11); border-radius: 3px; }

.guild-date-sep {
  text-align: center;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  align-self: center;
  background: rgba(255,255,255,0.05);
  padding: 3px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.06);
  margin: 14px 0 10px;
  user-select: none;
  letter-spacing: 0.5px;
}

.guild-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 2px 4px;
  position: relative;
  animation: msgIn 0.18s var(--ease) both;
  margin-bottom: 2px;
}
.guild-msg.grouped { margin-bottom: 1px; }
.guild-msg:hover .guild-msg-actions { opacity: 1; pointer-events: all; }

.guild-msg.mine { flex-direction: row-reverse; }
.guild-msg.mine .guild-msg-body { align-items: flex-end; }

.guild-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.25), rgba(5, 150, 105, 0.2));
  border: 1.5px solid rgba(35, 87, 232, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-light);
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--duration-fast);
  align-self: flex-end;
  margin-bottom: 2px;
}
.guild-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.guild-msg-avatar:hover { box-shadow: 0 0 0 2px var(--accent); }
.guild-msg.grouped .guild-msg-avatar { visibility: hidden; }

.guild-msg-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: min(72vw, 420px);
}

.guild-msg-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  padding: 0 2px;
}
.guild-msg.grouped .guild-msg-top { display: none; }

.guild-msg-username {
  cursor: pointer;
  transition: color 0.15s;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
}
.guild-msg-username:hover { color: var(--accent-light); }
.guild-msg.mine .guild-msg-username { color: var(--accent2-light); }

.guild-msg-skill-tag {
  font-size: 9px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.11);
  color: var(--muted);
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.guild-msg-time {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  opacity: 0.55;
  margin-left: auto;
  white-space: nowrap;
}
.guild-msg.mine .guild-msg-time { margin-left: 0; margin-right: auto; }

.guild-msg-text {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 3px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255,255,255,0.11);
  color: var(--text);
  max-width: 100%;
}
.guild-msg.mine .guild-msg-text {
  background: linear-gradient(145deg, var(--accent), #9A6428);
  color: #fff;
  border: none;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 12px rgba(35, 87, 232, 0.3);
}

.guild-msg-reply-ctx {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: rgba(35, 87, 232, 0.08);
  border-left: 2px solid var(--accent);
  border-radius: 6px 6px 0 0;
  padding: 5px 10px;
  margin-bottom: -6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: background var(--duration-fast);
}
.guild-msg-reply-ctx:hover { background: rgba(35, 87, 232, 0.14); }
.guild-msg.mine .guild-msg-reply-ctx {
  border-left: none;
  border-right: 2px solid var(--accent2);
  background: rgba(5, 150, 105, 0.07);
}

.guild-msg-sent-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
  padding-right: 2px;
}
.guild-sent-check {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent2-light);
  opacity: 0.65;
  letter-spacing: -1px;
}

.guild-expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  margin-top: 3px;
  align-self: flex-start;
  white-space: nowrap;
  opacity: 0.8;
}
.guild-msg.mine .guild-expiry-badge { align-self: flex-end; }
.guild-expiry-badge.safe { color: var(--muted); }
.guild-expiry-badge.warn { color: var(--accent3-light); }
.guild-expiry-badge.crit { color: var(--danger-light); animation: pulseGlow 2s ease-in-out infinite; }

.guild-you-badge { display: none; }

.guild-msg-deleted {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
  font-style: italic;
  opacity: 0.5;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 10px;
}

.guild-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.guild-msg.mine .guild-msg-reactions { justify-content: flex-end; }
.guild-reaction-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}
.guild-reaction-chip:hover,
.guild-reaction-chip.mine {
  background: rgba(35, 87, 232, 0.14);
  border-color: rgba(35, 87, 232, 0.3);
}
.guild-reaction-chip .rc-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.guild-reaction-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  background: var(--panel-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  display: none;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 50;
  animation: scaleIn 0.12s var(--ease-spring);
  max-width: calc(100vw - 24px);
}
.guild-reaction-picker.open { display: flex; }
.guild-msg.mine .guild-reaction-picker { right: 0; left: auto; }
.guild-msg:not(.mine) .guild-reaction-picker { left: 0; right: auto; }
.guild-reaction-picker.flip-left { left: auto !important; right: 0 !important; }
.guild-reaction-picker.flip-right { right: auto !important; left: 0 !important; }
.guild-reaction-picker.flip-up { bottom: auto !important; top: calc(100% + 6px) !important; }
.guild-reaction-opt {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text);
  padding: 4px 5px;
  border-radius: var(--radius-xs);
  transition: transform 0.12s var(--ease-spring);
  line-height: 1;
  outline: none;
}
.guild-reaction-opt:hover { transform: scale(1.4); background: rgba(35,87,232,0.08); }

.guild-msg-actions {
  position: absolute;
  top: -36px;
  opacity: 0;
  pointer-events: none;
  background: var(--panel-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 3px 4px;
  display: flex;
  gap: 1px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 20;
  transition: opacity var(--duration-fast);
  max-width: calc(100vw - 24px);
  white-space: nowrap;
}
.guild-msg:not(.mine) .guild-msg-actions { left: 40px; }
.guild-msg.mine .guild-msg-actions { right: 40px; }
.guild-msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--muted);
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  line-height: 1;
  outline: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.guild-msg-action-btn:hover { background: rgba(35, 87, 232, 0.15); color: var(--text); }
.guild-msg-action-btn.danger:hover { background: rgba(239, 68, 68, 0.15); color: var(--danger-light); }

.guild-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
}
.guild-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px 24px;
  animation: fadeUp var(--duration-slow) var(--ease) both;
}
.guild-empty-icon {
  font-size: 44px;
  filter: drop-shadow(0 0 12px rgba(35, 87, 232, 0.25));
  animation: floatSlow 4s ease-in-out infinite;
}
.guild-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.guild-empty-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 230px;
}

#guild-typing-bar {
  height: 20px;
  padding: 0 16px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.guild-typing-dots { display: none; }
.guild-typing-dots span {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 1px;
  animation: bounce 1.2s ease-in-out infinite;
}
.guild-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.guild-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
.guild-typing-label { display: none; font-size: 11px; }

#guild-reply-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-top: 1px solid var(--border);
  background: rgba(35, 87, 232, 0.10);
  flex-shrink: 0;
  animation: fadeIn var(--duration-fast) var(--ease);
}
#guild-reply-preview.active { display: flex; }
.guild-reply-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent-light);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.guild-reply-text {
  flex: 1;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guild-reply-cancel {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  padding: 2px 4px;
  transition: color var(--duration-fast);
  line-height: 1;
  outline: none;
  flex-shrink: 0;
}
.guild-reply-cancel:hover { color: var(--danger); }

.guild-input-area {
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
  background: rgba(248, 249, 252, 0.90);
}
.guild-input-wrap { flex: 1; min-width: 0; }
.guild-input-area .input {
  font-size: 14px;
  padding: 9px 13px;
  width: 100%;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.guild-input-area .input:focus {
  border-color: rgba(35, 87, 232, 0.35);
  box-shadow: 0 0 0 3px rgba(35, 87, 232, 0.08);
  outline: none;
}
.guild-input-area .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.11);
  color: var(--muted);
  cursor: pointer;
  outline: none;
}
.guild-input-area .icon-btn:hover {
  background: rgba(35, 87, 232, 0.12);
  border-color: rgba(35, 87, 232, 0.3);
  color: var(--accent-light);
}
.guild-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  cursor: pointer;
  color: white;
  font-size: 15px;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(35, 87, 232, 0.35);
  outline: none;
}
.guild-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(35, 87, 232, 0.5); }
.guild-send-btn:active { transform: scale(0.94); }
.guild-send-btn:disabled { opacity: 0.3; pointer-events: none; transform: none; box-shadow: none; }
.guild-voice-btn-recording {
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  animation: pulseGlow 1s ease-in-out infinite;
}

@keyframes guildHighlight {
  0%   { background: rgba(35, 87, 232, 0.15); }
  100% { background: transparent; }
}
.guild-msg.highlight-flash {
  animation: guildHighlight 1.2s ease both;
  border-radius: var(--radius-md);
}

@media (min-width: 1024px) {
  #guild-screen { height: 100dvh; }
  .guild-msg-body { max-width: 520px; }
}

#explore-screen {
  padding: 0; gap: 0;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}
#explore-screen.active { display: flex; }
#explore-screen #posts-feed { flex: none; overflow: visible; }
#explore-screen #leaderboard-panel { flex: none; overflow: visible; }
#explore-screen #people-panel { flex: none; overflow: visible; }

#stories-bar-wrap {
  background: rgba(248, 249, 252, 0.90);
  border-bottom: 1px solid var(--border);
}
#stories-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 8px 12px 8px;
  scrollbar-width: none;
}
#stories-scroll::-webkit-scrollbar { display: none; }

.explore-top {
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 249, 252, 0.90);
  -webkit-}
.explore-top-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 7px;
}
.explore-top-row h2 {
  font-size: 16px; font-weight: 800; margin: 0; flex-shrink: 0;
}
.explore-top-row .explore-search-wrap {
  flex: 1; position: relative;
}
.explore-top-row .explore-search-wrap input {
  width: 100%; font-size: 12px;
  padding: 6px 10px 6px 28px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-display);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.explore-top-row .explore-search-wrap input:focus {
  border-color: rgba(35, 87, 232, 0.45);
  box-shadow: 0 0 0 3px rgba(35, 87, 232, 0.08);
  background: rgba(255,255,255,0.06);
}
.explore-top-row .explore-search-wrap::before {
  content: '';
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background-color: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center/contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center/contain;
  pointer-events: none;
}
.explore-top-row .feed-sort-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px; font-family: var(--font-mono);
  padding: 5px 8px; cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--duration-fast);
}
.explore-top-row .feed-sort-btn:focus,
.explore-top-row .feed-sort-btn:hover {
  border-color: rgba(35, 87, 232, 0.4); color: var(--text);
}

.explore-top-row--single {
  display: flex; align-items: center; gap: 6px; padding: 0 16px; flex-wrap: nowrap;
}
.explore-search-wrap--combo {
  flex: 1; min-width: 0; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; height: 38px;
}
.explore-search-wrap--combo input {
  flex: 1; border: none; background: transparent; padding: 0 10px; height: 100%;
  font-family: var(--font-display); font-size: 13px; color: var(--text); outline: none;
}
.explore-search-wrap--combo input::placeholder { color: var(--muted); }
.feed-sort-inline {
  border: none; border-left: 1px solid var(--border); background: transparent;
  color: var(--muted); font-family: var(--font-display); font-size: 11px;
  padding: 0 8px; height: 100%; cursor: pointer; outline: none; white-space: nowrap;
  min-width: 80px; flex-shrink: 0;
}
.feed-sort-inline:focus { color: var(--accent); }
.explore-filter-dropdown-wrap { position: relative; flex-shrink: 0; }
.explore-filter-dropdown-btn {
  display: flex; align-items: center; gap: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 10px; height: 38px; cursor: pointer; color: var(--text);
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  white-space: nowrap; transition: border-color var(--duration-fast);
}
.explore-filter-dropdown-btn:hover { border-color: var(--border-hover); color: var(--accent); }
.explore-filter-dropdown-btn.open { border-color: var(--accent); color: var(--accent); }
.explore-filter-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown); min-width: 140px; overflow: hidden;
  padding: 4px;
}
.explore-filter-dropdown-menu.open { display: block; }
.explore-filter-option {
  display: flex; align-items: center; gap: 7px; width: 100%; background: none;
  border: none; padding: 9px 12px; font-family: var(--font-display); font-size: 13px;
  color: var(--text-secondary); cursor: pointer; border-radius: var(--radius-xs);
  text-align: left; transition: background var(--duration-fast);
}
.explore-filter-option:hover { background: var(--bg); color: var(--text); }
.explore-filter-option.active { color: var(--accent); font-weight: 700; background: rgba(35,87,232,0.07); }
html[data-theme="dev"] .explore-filter-option.active { background: rgba(29,155,240,0.10); }

.explore-filters {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 2px 0 9px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.explore-filters::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-display);
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease);
  outline: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.1px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  user-select: none;
}
.filter-pill:hover {
  border-color: rgba(35, 87, 232, 0.45);
  color: var(--text);
  background: rgba(35, 87, 232, 0.06);
  box-shadow: 0 2px 8px rgba(35,87,232,0.12);
  transform: translateY(-1px);
}
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(35, 87, 232, 0.35);
  transform: translateY(-1px);
}
.filter-pill.active:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(35, 87, 232, 0.42);
}
.filter-pill .lucide { opacity: 0.85; }

.explore-tab-bar {
  display: flex; gap: 0; border-bottom: none;
  padding: 0; flex-shrink: 0;
}
.explore-tab {
  font-size: 11px; font-family: var(--font-mono); font-weight: 700;
  padding: 6px 14px; cursor: pointer; border: none; background: none;
  color: var(--muted); border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s; letter-spacing: 0.5px;
}
.explore-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }

#posts-feed {
  flex: none;
  overflow: visible;
  padding: 8px 10px calc(var(--screen-pb) + 8px);
}
@media (min-width: 768px) {
  #posts-feed { padding-bottom: 20px; }
}

@keyframes skeletonPulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes skeletonFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.skel {
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.05) 30%,
    rgba(35, 87, 232, 0.07)  48%,
    rgba(255,255,255,0.06) 55%,
    rgba(255,255,255,0.05) 70%,
    rgba(255,255,255,0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
  will-change: background-position;
}

html[data-theme="dev"] .skel {
  background: linear-gradient(
    100deg,
    rgba(29, 155, 240, 0.03)  0%,
    rgba(29, 155, 240, 0.03)  30%,
    rgba(29, 155, 240, 0.10)  48%,
    rgba(29, 155, 240, 0.06)  55%,
    rgba(29, 155, 240, 0.03)  70%,
    rgba(29, 155, 240, 0.03)  100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.8s ease-in-out infinite;
}

.skeleton-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  animation: skeletonFadeIn 0.4s var(--ease) both;
}
.skeleton-card:nth-child(2) { animation-delay: 0.06s; }
.skeleton-card:nth-child(3) { animation-delay: 0.12s; }
.skeleton-card:nth-child(4) { animation-delay: 0.18s; }
.skeleton-card:nth-child(5) { animation-delay: 0.24s; }

.skeleton-post {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skeleton-post:nth-child(2) { animation-delay: 0.08s; }

.skeleton-line {
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.05) 30%,
    rgba(35, 87, 232, 0.07)  48%,
    rgba(255,255,255,0.05) 55%,
    rgba(255,255,255,0.05) 70%,
    rgba(255,255,255,0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.8s ease-in-out infinite;
  border-radius: 6px;
  height: 10px;
  margin-bottom: 8px;
}
html[data-theme="dev"] .skeleton-line {
  background: linear-gradient(100deg,rgba(29, 155, 240, 0.03) 0%,rgba(29, 155, 240, 0.03) 30%,rgba(29, 155, 240, 0.09) 48%,rgba(29, 155, 240, 0.05) 55%,rgba(29, 155, 240, 0.03) 70%,rgba(29, 155, 240, 0.03) 100%);
  background-size: 200% 100%;
}
.skeleton-line.short  { width: 52%; }
.skeleton-line.medium { width: 78%; }
.skeleton-line.tall   { height: 60px; width: 100%; border-radius: var(--radius-md); }
.skeleton-line.full   { width: 100%; }
.skeleton-line.xs     { height: 7px; }
.skeleton-line.sm     { height: 8px; }
.skeleton-line.lg     { height: 14px; }
.skeleton-line.xl     { height: 18px; }

.skel-circle {
  border-radius: 50%;
  flex-shrink: 0;
}
.skel-round {
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.skel-pill {
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.skel-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-user-card:nth-child(1) { animation-delay: 0.00s; }
.skel-user-card:nth-child(2) { animation-delay: 0.06s; }
.skel-user-card:nth-child(3) { animation-delay: 0.12s; }
.skel-user-card:nth-child(4) { animation-delay: 0.18s; }
.skel-user-card:nth-child(5) { animation-delay: 0.24s; }
.skel-user-card:nth-child(6) { animation-delay: 0.30s; }
.skel-user-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.skel-user-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skel-post-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-post-card:nth-child(2) { animation-delay: 0.07s; }
.skel-post-card:nth-child(3) { animation-delay: 0.14s; }
.skel-post-card:nth-child(4) { animation-delay: 0.21s; }
.skel-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.skel-post-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skel-post-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.skel-msgs-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}
.skel-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-msg-row.right {
  flex-direction: row-reverse;
}
.skel-msg-row:nth-child(1) { animation-delay: 0.00s; }
.skel-msg-row:nth-child(2) { animation-delay: 0.07s; }
.skel-msg-row:nth-child(3) { animation-delay: 0.14s; }
.skel-msg-row:nth-child(4) { animation-delay: 0.21s; }
.skel-msg-row:nth-child(5) { animation-delay: 0.28s; }
.skel-msg-bubble {
  border-radius: 16px;
  height: 38px;
}
.skel-msg-bubble.short  { width: 120px; }
.skel-msg-bubble.medium { width: 180px; }
.skel-msg-bubble.long   { width: 230px; }
.skel-msg-row.right .skel-msg-bubble {
  border-bottom-right-radius: 4px;
}
.skel-msg-row:not(.right) .skel-msg-bubble {
  border-bottom-left-radius: 4px;
}

.skel-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-lb-row:last-child { border-bottom: none; }
.skel-lb-row:nth-child(1) { animation-delay: 0.00s; }
.skel-lb-row:nth-child(2) { animation-delay: 0.05s; }
.skel-lb-row:nth-child(3) { animation-delay: 0.10s; }
.skel-lb-row:nth-child(4) { animation-delay: 0.15s; }
.skel-lb-row:nth-child(5) { animation-delay: 0.20s; }
.skel-lb-row:nth-child(6) { animation-delay: 0.25s; }
.skel-lb-row:nth-child(7) { animation-delay: 0.30s; }
.skel-lb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skel-collab-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-collab-card:nth-child(2) { animation-delay: 0.08s; }
.skel-collab-card:nth-child(3) { animation-delay: 0.16s; }
.skel-collab-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skel-people-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-people-card:nth-child(1) { animation-delay: 0.00s; }
.skel-people-card:nth-child(2) { animation-delay: 0.06s; }
.skel-people-card:nth-child(3) { animation-delay: 0.12s; }
.skel-people-card:nth-child(4) { animation-delay: 0.18s; }
.skel-people-card:nth-child(5) { animation-delay: 0.24s; }
.skel-people-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skel-people-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.skel-ups-post {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-ups-post:nth-child(2) { animation-delay: 0.08s; }
.skel-ups-post:nth-child(3) { animation-delay: 0.16s; }
.skel-ups-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.skel-ups-post-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skel-saved-post {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-saved-post:nth-child(2) { animation-delay: 0.08s; }
.skel-saved-post:nth-child(3) { animation-delay: 0.16s; }

.skel-rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  flex-shrink: 0;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-rec-pill:nth-child(2) { animation-delay: 0.07s; }
.skel-rec-pill:nth-child(3) { animation-delay: 0.14s; }

.skel-guild-msgs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  flex: 1;
}
.skel-guild-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-guild-msg-row:nth-child(1) { animation-delay: 0.00s; }
.skel-guild-msg-row:nth-child(2) { animation-delay: 0.07s; }
.skel-guild-msg-row:nth-child(3) { animation-delay: 0.14s; }
.skel-guild-msg-row:nth-child(4) { animation-delay: 0.21s; }
.skel-guild-msg-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.skel-guild-bubble {
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  height: 36px;
}

.skel-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-notif-item:nth-child(2) { animation-delay: 0.06s; }
.skel-notif-item:nth-child(3) { animation-delay: 0.12s; }
.skel-notif-item:nth-child(4) { animation-delay: 0.18s; }
.skel-notif-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skel-room-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  animation: skeletonFadeIn 0.35s var(--ease) both;
}
.skel-room-card:nth-child(2) { animation-delay: 0.07s; }
.skel-room-card:nth-child(3) { animation-delay: 0.14s; }
.skel-room-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html[data-theme="dev"] .skel-room-card {
  border-color: rgba(29, 155, 240, 0.06);
}
html[data-theme="dev"] .skel-user-card,
html[data-theme="dev"] .skel-post-card,
html[data-theme="dev"] .skel-lb-row,
html[data-theme="dev"] .skel-collab-card,
html[data-theme="dev"] .skel-people-card,
html[data-theme="dev"] .skel-ups-post,
html[data-theme="dev"] .skel-saved-post,
html[data-theme="dev"] .skel-notif-item,
html[data-theme="dev"] .skel-guild-msg-row {
  border-color: rgba(29, 155, 240, 0.06);
}
html[data-theme="dev"] .skel-collab-card,
html[data-theme="dev"] .skel-ups-post,
html[data-theme="dev"] .skel-saved-post,
html[data-theme="dev"] .skel-post-card {
  background: rgba(29, 155, 240, 0.015);
}

.post-card {
  contain: layout;
  content-visibility: auto;
  contain-intrinsic-size: 0 160px;
  background: rgba(255, 255, 255, 0.95); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  margin-bottom: 10px; transition: border-color var(--duration-fast);
  animation: fadeUp var(--duration-slow) var(--ease) both;
  position: relative; overflow: hidden;
}
.post-card:hover { border-color: rgba(35, 87, 232, 0.25); }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
  flex-shrink: 0; overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { flex: 1; min-width: 0; }
.post-username { font-size: 13px; font-weight: 700; transition: color 0.15s; }
.post-username:hover { color: var(--accent-light); }
.post-meta-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.post-skill-tag {
  display: inline-block; font-size: 10px; font-family: var(--font-mono);
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.1); border: 1px solid rgba(35, 87, 232, 0.2);
  color: var(--accent-light); margin-top: 2px;
}
.post-expiry {
  font-size: 9px; font-family: var(--font-mono); color: var(--muted);
  display: flex; align-items: center; gap: 3px;
}
.post-expiry.warning { color: var(--accent3-light); }
.post-expiry.critical { color: var(--danger-light); animation: pulseGlow 2s ease-in-out infinite; }

.post-content { font-size: 14px; line-height: 1.55; color: var(--text); margin-bottom: 10px; word-break: break-word; }
.post-edited-badge {
  display: inline-block;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-left: 4px;
  opacity: 0.7;
}
.post-image {
  width: 100%; border-radius: var(--radius-md); margin-bottom: 10px;
  max-height: 240px; object-fit: cover; border: 1px solid var(--border);
  cursor: pointer; transition: opacity var(--duration-fast);
  background: var(--surface);
}
.post-image:hover { opacity: 0.9; }
.post-image:not([src]), .post-image[src=""] { display: none; }
.post-image[src]:not([src=""]) { display: block; }
.post-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.post-tag {
  font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill);
  background: rgba(5, 150, 105, 0.07); border: 1px solid rgba(5, 150, 105, 0.18);
  color: var(--accent2-light); font-family: var(--font-mono);
}
.post-goal-badge {
  font-size: 10px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent3-light); font-family: var(--font-mono);
  margin-left: 4px;
}
.post-actions { display: flex; gap: 6px; align-items: center; }
.post-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: none;
  font-size: 12px; color: var(--muted); cursor: pointer;
  font-family: var(--font-display); transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
}
.post-action-btn:hover { border-color: var(--border-hover); color: var(--text); }
.post-action-btn.liked { color: #f472b6; border-color: rgba(244, 114, 182, 0.35); background: rgba(244, 114, 182, 0.06); }
.post-action-btn.liked .btn-icon { animation: heartPop 0.3s var(--ease-spring); }
.post-action-btn.connect-btn { color: var(--accent); border-color: rgba(35, 87, 232, 0.3); background: rgba(35, 87, 232, 0.15); }
.post-action-btn.connect-btn:hover { background: rgba(35, 87, 232, 0.12); }
.post-action-btn.saved-btn { color: var(--accent3); border-color: rgba(245, 158, 11, 0.3); }
.post-action-btn.delete-btn { color: var(--danger-light); border-color: rgba(239, 68, 68, 0.25); }
.post-action-btn.delete-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.5); color: var(--danger); }
.btn-icon { font-size: 14px; line-height: 1; }
.like-count, .comment-count { font-size: 12px; }

@keyframes heartPop { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }

.post-comments-panel {
  display: none; border-top: 1px solid var(--border);
  margin-top: 10px; padding-top: 10px;
}
.post-comments-panel.open { display: block; animation: fadeIn var(--duration-fast) var(--ease); }
.comment-item { display: flex; gap: 8px; margin-bottom: 8px; }
.comment-avatar {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-username { font-size: 11px; font-weight: 700; color: var(--accent-light); }
.comment-text { font-size: 12px; color: var(--text); line-height: 1.4; }
.comment-input-row { display: flex; gap: 6px; margin-top: 8px; }
.comment-input { flex: 1; font-size: 13px; padding: 7px 12px; border-radius: var(--radius-sm); }
.comment-send-btn {
  padding: 7px 14px; background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; color: white; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-family: var(--font-display);
  font-weight: 700; transition: opacity var(--duration-fast); outline: none;
}
.comment-send-btn:hover { opacity: 0.9; }

#create-screen { padding: 0; gap: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.16) transparent; }
#create-screen::-webkit-scrollbar { width: 4px; }
#create-screen::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 4px; }
.create-header {
  padding: 16px 18px 0; flex-shrink: 0;
}
.create-header h2 { font-size: 20px; font-weight: 800; margin-bottom: 2px; }
.create-microcopy {
  font-size: 12px; color: var(--accent-light); font-family: var(--font-mono);
  margin-bottom: 14px; display: flex; align-items: center; gap: 5px;
}
.create-body { padding: 0 18px calc(var(--screen-pb) + 8px); display: flex; flex-direction: column; gap: 14px; }
.create-section-label {
  font-size: 10px; font-family: var(--font-mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px;
}
#create-textarea {
  width: 100%; font-size: 14px; line-height: 1.6;
  padding: 12px 14px; border-radius: var(--radius-md); resize: none;
  min-height: 100px; max-height: 200px; overflow-y: auto;
  font-family: var(--font-display);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
#create-textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(35, 87, 232, 0.1); outline: none; }
.create-image-area {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px; cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); min-height: 70px;
  position: relative; overflow: hidden;
}
.create-image-area:hover { border-color: var(--border-hover); background: rgba(35, 87, 232, 0.10); }
.create-image-area.has-image { padding: 0; border-style: solid; }
.create-image-area span { font-size: 12px; color: var(--muted); }
#create-img-preview {
  width: 100%; max-height: 200px; object-fit: cover;
  border-radius: calc(var(--radius-md) - 2px); display: none;
}
#create-img-preview.visible { display: block; }
.create-img-clear {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.7); border: none; color: white;
  border-radius: 50%; width: 24px; height: 24px;
  font-size: 12px; cursor: pointer; display: none;
  align-items: center; justify-content: center; line-height: 1;
  outline: none;
}
.create-img-clear.visible { display: flex; }
.create-goals-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.create-goal-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-display);
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease);
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  user-select: none;
}
.create-goal-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(35, 87, 232, 0.35);
  transform: translateY(-1px);
}
.create-goal-pill:hover {
  border-color: rgba(35, 87, 232, 0.45);
  color: var(--text);
  background: rgba(35, 87, 232, 0.06);
  box-shadow: 0 2px 8px rgba(35,87,232,0.12);
  transform: translateY(-1px);
}
#create-post-btn {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; color: white; border-radius: var(--radius-md);
  cursor: pointer; font-family: var(--font-display);
  box-shadow: 0 4px 20px var(--glow-accent);
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none; margin-top: 4px;
}
#create-post-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(35, 87, 232, 0.45); }
#create-post-btn:active { transform: translateY(0); }
#create-post-btn:disabled { opacity: 0.45; pointer-events: none; }
.create-char-count {
  font-size: 10px; font-family: var(--font-mono); color: var(--muted);
  text-align: right; margin-top: -10px;
}
.create-char-count.warn { color: var(--accent3-light); }
.create-char-count.danger { color: var(--danger-light); }

#downloads-screen { padding: 0; gap: 0; }
#downloads-screen { display: none !important; pointer-events: none !important; }
.downloads-top {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.downloads-top h2 { font-size: 17px; font-weight: 800; }
.downloads-sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
#saved-posts-list {
  flex: 1; overflow-y: auto; padding: 10px 12px 16px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.16) transparent;
}
#saved-posts-list::-webkit-scrollbar { width: 4px; }
#saved-posts-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 4px; }
.saved-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-pill); padding: 2px 8px;
  font-size: 9px; font-family: var(--font-mono); color: var(--accent3-light);
}
@media (max-height: 680px) { .login-emblem { width: 60px; height: 60px; font-size: 24px; } .login-emblem img { width: 40px; height: 40px; } .login-title { font-size: 24px; } .loading-logo { font-size: 36px; } }
@media (max-height: 580px) {
  #login-screen { gap: 8px; }
  .login-emblem { width: 50px; height: 50px; font-size: 20px; margin-bottom: 2px; animation: none; }
  .login-emblem img { width: 34px; height: 34px; }
  .login-title { font-size: 20px; }
  .login-sub { font-size: 12px; margin-bottom: 8px; }
  .tagline { margin-bottom: 10px; padding: 3px 10px; }
  .onboard-heading { font-size: 20px; }
  .onboard-icon { font-size: 32px; margin-bottom: 8px; }
  .onboard-step { padding: 18px 18px 18px; }
}

.story-bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.story-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2), #ec4899);
  box-shadow: 0 0 0 2px var(--bg), 0 2px 12px rgba(35, 87, 232, 0.3);
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast);
  position: relative;
}
.story-bubble:hover { transform: scale(1.06); box-shadow: 0 0 0 2px var(--bg), 0 4px 18px rgba(35, 87, 232, 0.5); }
.story-bubble.seen {
  background: rgba(110,101,96,0.3);
  box-shadow: 0 0 0 2px var(--bg), 0 2px 8px rgba(0,0,0,0.2);
}
.story-bubble-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.story-bubble-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-bubble.add-story {
  background: rgba(35, 87, 232, 0.15);
  border: 2px dashed rgba(35, 87, 232, 0.4);
  padding: 0;
  box-shadow: none;
}
.story-bubble.add-story:hover {
  background: rgba(35, 87, 232, 0.25);
  border-color: rgba(35, 87, 232, 0.7);
  box-shadow: 0 0 0 2px var(--bg), 0 4px 14px rgba(35, 87, 232, 0.25);
}
.story-add-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent);
}
.story-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: center;
  max-width: 54px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.story-label.unseen { color: var(--accent-light); font-weight: 700; }

#story-viewer {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-lightbox) + 10);
  background: rgba(0,0,0,0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  will-change: opacity;
}
#story-viewer.active {
  opacity: 1;
  pointer-events: all;
}
.story-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}
.story-progress-bars {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 15;
}
.story-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  overflow: hidden;
}
.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: none;
}
.story-progress-fill.done { width: 100%; }
.story-progress-fill.active {
  width: 0%;
  animation: storyProgress var(--story-duration, 5s) linear forwards;
}
@keyframes storyProgress {
  from { width: 0%; }
  to   { width: 100%; }
}
.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.story-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.story-viewer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-viewer-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.story-viewer-time {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-family: var(--font-mono);
}
.story-viewer-close {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
  outline: none;
}
.story-viewer-close:hover { background: rgba(255,255,255,0.2); }
.story-content-area {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 8vh, 80px) 20px calc(var(--screen-pb) + clamp(40px,8vh,80px));
  flex: 1;
  position: relative;
}
.story-image-display {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
}
.story-text-display {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  padding: 20px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  word-break: break-word;
}
.story-tap-zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  z-index: 5;
}
.story-tap-prev { left: 0; }
.story-tap-next { right: 0; }
.story-viewer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.story-follow-btn-viewer {
  flex: 1;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(35, 87, 232, 0.5);
  background: rgba(35, 87, 232, 0.15);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
}
.story-follow-btn-viewer:hover { background: rgba(35, 87, 232, 0.3); }
.story-follow-btn-viewer.following {
  border-color: rgba(16,185,129,0.5);
  background: rgba(16,185,129,0.1);
  color: var(--success-light);
}

#story-create-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  will-change: opacity;
}
#story-create-modal.active {
  opacity: 1;
  pointer-events: all;
}
.story-create-sheet {
  background: var(--panel-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
  will-change: transform;
}
#story-create-modal.active .story-create-sheet { transform: translateY(0); }
.story-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.story-create-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.story-create-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  outline: none;
  transition: color var(--duration-fast);
}
.story-create-close:hover { color: var(--text); }
.story-type-tabs {
  display: flex;
  gap: 6px;
}
.story-type-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  outline: none;
}
.story-type-tab.active {
  border-color: rgba(35, 87, 232, 0.5);
  background: rgba(35, 87, 232, 0.1);
  color: var(--accent-light);
}
.story-type-tab:hover { border-color: var(--border-hover); color: var(--text); }
#story-text-input {
  resize: none;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100px;
}
.story-image-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: none;
}
.story-image-preview.visible { display: block; }
.story-image-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed rgba(35, 87, 232, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.story-image-upload-label:hover { border-color: rgba(35, 87, 232, 0.55); color: var(--accent-light); background: rgba(35, 87, 232, 0.10); }
.story-post-btn {
  width: 100%;
  padding: 13px;
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  color: #fff;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-display);
  box-shadow: 0 4px 18px var(--glow-accent);
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
}
.story-post-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(35, 87, 232, 0.45); }
.story-post-btn:disabled { opacity: 0.45; pointer-events: none; }

.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(35, 87, 232, 0.45);
  background: rgba(35, 87, 232, 0.1);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  outline: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.follow-btn:hover {
  background: rgba(35, 87, 232, 0.22);
  border-color: rgba(35, 87, 232, 0.7);
  transform: translateY(-1px);
}
.follow-btn:active { transform: translateY(0); }
.follow-btn.following {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.35);
  color: var(--success-light);
}
.follow-btn.following:hover {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.35);
  color: var(--danger-light);
}
.follow-stats-row {
  display: flex;
  gap: 18px;
  margin: 6px 0 4px;
}
.follow-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  transition: opacity var(--duration-fast);
}
.follow-stat:hover { opacity: 0.8; }
.follow-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}
.follow-stat-lbl {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.mutual-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent2-light);
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}
.post-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(35, 87, 232, 0.35);
  background: rgba(35, 87, 232, 0.07);
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
}
.post-follow-btn:hover { background: rgba(35, 87, 232, 0.16); border-color: rgba(35, 87, 232, 0.6); }
.post-follow-btn.following {
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.06);
  color: var(--success-light);
}
.post-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.1);
  border: 1px solid rgba(35, 87, 232, 0.2);
  color: var(--accent-light);
  margin-left: 4px;
}
.post-priority-badge.followed {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.2);
  color: var(--success-light);
}

.feed-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 2px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  border-radius: 1px;
}

#user-profile-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0,0,0,0.0);
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), background 0.28s var(--ease);
}
#user-profile-sheet.active {
  opacity: 1;
  pointer-events: all;
  background: rgba(0,0,0,0.0);
}
.user-profile-sheet-inner {
  background: linear-gradient(160deg, #182432 0%, #15202B 100%);
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.22,1,0.36,1);
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 87, 232, 0.18) transparent;
  box-shadow: none;
}
#user-profile-sheet.active .user-profile-sheet-inner { transform: translateY(0); }

@media (min-width: 768px) {
  #user-profile-sheet {
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.0);
    padding: clamp(16px, 3vh, 32px);
  }
  #user-profile-sheet.active {
    background: rgba(0,0,0,0.72);
    transition: opacity 0.28s var(--ease), background 0.28s var(--ease);
  }
  .user-profile-sheet-inner {
    border-radius: 28px;
    border: 1px solid rgba(35, 87, 232, 0.22);
    max-width: min(560px, calc(100vw - 48px));
    width: min(560px, calc(100vw - 48px));
    height: min(88dvh, 780px);
    max-height: min(88dvh, 780px);
    transform: scale(0.92) translateY(24px);
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(35, 87, 232, 0.14);
    transition: transform 0.38s cubic-bezier(0.22,1,0.36,1);
  }
  #user-profile-sheet.active .user-profile-sheet-inner {
    transform: scale(1) translateY(0);
  }
  .ups-drag-handle { display: none; }
  .ups-cover {
    border-radius: 28px 28px 0 0;
    overflow: visible;
  }
  .ups-cover::after {
    border-radius: 28px 28px 0 0;
  }
}
@media (max-width: 560px) {
  .user-profile-sheet-inner {
    max-width: calc(100vw - 2px);
  }
  .ups-body {
    padding: 50px 16px 18px;
    min-width: 0;
  }
  .ups-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ups-follow-row {
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .ups-actions-row {
    flex-wrap: wrap;
  }
  .ups-msg-btn,
  .ups-endorse-btn {
    min-width: 0;
  }
}

.ups-drag-handle {
  display: none;
}

.ups-cover {
  position: relative;
  height: calc(130px + var(--safe-top, 0px));
  padding-top: var(--safe-top, 0px);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.3) 0%, rgba(5, 150, 105, 0.18) 50%, rgba(245,158,11,0.12) 100%);
  flex-shrink: 0;
  overflow: visible;
}
.ups-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='g1' cx='20%25' cy='50%25' r='60%25'%3E%3Cstop offset='0%25' stop-color='%238b5cf6' stop-opacity='0.15'/%3E%3Cstop offset='100%25' stop-color='transparent'/%3E%3C/radialGradient%3E%3CradialGradient id='g2' cx='80%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%2306b6d4' stop-opacity='0.12'/%3E%3Cstop offset='100%25' stop-color='transparent'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect fill='url(%23g1)' width='400' height='120'/%3E%3Crect fill='url(%23g2)' width='400' height='120'/%3E%3C/svg%3E") center/cover;
  pointer-events: none;
  overflow: hidden;
}
.ups-cover-close {
  position: absolute;
  top: 12px; left: 14px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.8);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s; outline: none; z-index: 2;
}
.ups-cover-close:hover { background: rgba(0,0,0,0.65); color: #fff; }

.ups-avatar-wrap {
  position: absolute;
  bottom: -40px; left: 20px;
  z-index: 3;
}
.ups-avatar-outer {
  width: 76px; height: 76px;
  border-radius: 22px;
  padding: 3px;
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}
.ups-avatar-outer:hover { transform: scale(1.06); }
.ups-avatar-outer.no-story {
  background: rgba(35, 87, 232, 0.35);
  padding: 2px;
  cursor: default;
}
.ups-avatar-outer.no-story:hover { transform: none; }
.ups-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 19px;
  background: var(--panel-solid, #FFFFFF);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
  border: 2px solid #15202B;
}
.ups-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.ups-story-badge {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 20px; height: 20px;
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  border-radius: 50%;
  border: 2px solid #15202B;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff; font-weight: 800;
}

.ups-body {
  padding: 50px 20px calc(20px + var(--safe-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ups-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ups-name-block { flex: 1; min-width: 0; }
.ups-display-name {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ups-handle {
  font-size: 12px; color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.ups-follow-btn-wrap {
  flex-shrink: 0;
}
.ups-follow-action-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; outline: none;
  transition: color 0.18s var(--ease-spring), background 0.18s var(--ease-spring), border-color 0.18s var(--ease-spring), box-shadow 0.18s var(--ease-spring), transform 0.18s var(--ease-spring), opacity 0.18s var(--ease-spring);
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}
.ups-follow-action-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(35, 87, 232, 0.4); }
.ups-follow-action-btn.following {
  background: transparent;
  border-color: rgba(35, 87, 232, 0.4);
  color: var(--accent-light);
}
.ups-follow-action-btn.following:hover { background: rgba(35, 87, 232, 0.1); }

.ups-bio-text {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 14px;
  white-space: pre-wrap;
}

.ups-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.ups-stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  transition: border-color 0.15s;
  min-width: 0;
}
.ups-stat-card:hover { border-color: rgba(35, 87, 232, 0.25); }
.ups-stat-val {
  font-size: 15px; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-light);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}
.ups-stat-val.green { color: var(--success-light); }
.ups-stat-val.cyan { color: var(--accent2-light); font-size: clamp(9px, 2.8vw, 13px); letter-spacing: -0.3px; }
.ups-stat-val.amber { color: var(--accent3-light); }
.ups-stat-lbl {
  font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.ups-follow-row {
  display: flex; gap: 16px; margin-bottom: 14px; align-items: center;
}
.ups-follow-stat { display: flex; align-items: baseline; gap: 4px; cursor: default; }
.ups-follow-stat-val { font-size: 14px; font-weight: 800; color: var(--text); }
.ups-follow-stat-lbl { font-size: 11px; color: var(--muted); }
.ups-mutual-pill {
  display: none;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.12); border: 1px solid rgba(35, 87, 232, 0.3);
  color: var(--accent-light); font-size: 10px; font-weight: 700;
  font-family: var(--font-mono);
}
.ups-mutual-pill.show { display: inline-block; }

.ups-skill-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.1); border: 1px solid rgba(35, 87, 232, 0.28);
  color: var(--accent-light); font-size: 11px; font-weight: 700;
  font-family: var(--font-mono); margin-bottom: 14px;
}

.ups-actions-row {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.ups-msg-btn {
  flex: 1; padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(35, 87, 232, 0.35);
  background: rgba(35, 87, 232, 0.08);
  color: var(--text); font-size: 13px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s; outline: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ups-msg-btn:hover { background: rgba(35, 87, 232, 0.18); border-color: rgba(35, 87, 232, 0.6); transform: translateY(-1px); }
.ups-endorse-btn {
  flex: 1; padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.07);
  color: var(--success-light); font-size: 13px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s; outline: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ups-endorse-btn:hover { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.5); transform: translateY(-1px); }
.ups-endorse-btn.endorsed { background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.45); color: #6ee7b7; }
.ups-endorse-btn:disabled { opacity: 0.4; pointer-events: none; }

.ups-expertise-section { margin-bottom: 16px; }
.ups-section-label {
  font-size: 10px; color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.ups-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 6px 0 16px;
}

.ups-quick-actions {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.ups-qa-btn {
  flex: 1; min-width: 80px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary); font-size: 11px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s; outline: none;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.ups-qa-btn:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.16); color: var(--text); }
.ups-qa-btn.danger { color: rgba(239,68,68,0.7); border-color: rgba(239,68,68,0.12); background: rgba(239,68,68,0.04); }
.ups-qa-btn.danger:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.35); color: var(--danger-light); }

#qr-modal-overlay {
  position: fixed; inset: 0; z-index: 2200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease);
}
#qr-modal-overlay.open { opacity: 1; pointer-events: all; }
#qr-modal {
  background: var(--surface); border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--radius-xl); padding: 28px 24px 24px;
  width: min(360px, calc(100vw - 32px));
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  transform: scale(0.92) translateY(16px);
  transition: transform 220ms var(--ease-spring);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06), 0 0 32px rgba(37,99,235,0.1);
}
#qr-modal-overlay.open #qr-modal { transform: scale(1) translateY(0); }
.qr-modal-title {
  font-size: 15px; font-weight: 800; color: var(--text); text-align: center;
}
.qr-modal-sub {
  font-size: 11px; color: var(--muted); text-align: center;
  font-family: var(--font-mono); letter-spacing: 0.3px; margin-top: -8px;
}
#qr-canvas-wrap {
  padding: 14px; background: var(--qr-canvas-bg, #FFFFFF); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), 0 0 0 1px rgba(37,99,235,0.2), 0 0 20px rgba(37,99,235,0.08);
}
#qr-canvas-wrap canvas, #qr-canvas-wrap img { display: block; }
.qr-modal-url {
  font-size: 10px; color: var(--muted); font-family: var(--font-mono);
  text-align: center; word-break: break-all; max-width: 280px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px;
}
.qr-modal-btns { display: flex; gap: 8px; width: 100%; }
.qr-modal-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: rgba(255,255,255,0.06);
  color: var(--text-secondary); font-size: 12px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 150ms var(--ease);
}
.qr-modal-btn:hover { background: rgba(255,255,255,0.11); color: var(--text); border-color: rgba(255,255,255,0.16); }
.qr-modal-btn.primary {
  background: rgba(var(--accent-rgb, 35,87,232), 0.1);
  border-color: rgba(var(--accent-rgb, 35,87,232), 0.3);
  color: var(--accent-light);
}
.qr-modal-btn.primary:hover { background: rgba(var(--accent-rgb, 35,87,232), 0.2); }

#fwd-modal-overlay {
  position: fixed; inset: 0; z-index: 2200;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 180ms var(--ease);
}
@media (min-width: 600px) {
  #fwd-modal-overlay { align-items: center; }
}
#fwd-modal-overlay.open { opacity: 1; pointer-events: all; }
#fwd-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 32px; width: min(480px, 100%);
  max-height: 70vh; display: flex; flex-direction: column; gap: 14px;
  transform: translateY(100%); transition: transform 250ms var(--ease-spring);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
@media (min-width: 600px) {
  #fwd-modal { border-radius: var(--radius-xl); transform: scale(0.94) translateY(12px); }
  #fwd-modal-overlay.open #fwd-modal { transform: scale(1) translateY(0); }
}
#fwd-modal-overlay.open #fwd-modal { transform: translateY(0); }
.fwd-modal-header {
  display: flex; align-items: center; justify-content: space-between;
}
.fwd-modal-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.fwd-modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255,255,255,0.06);
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 150ms var(--ease);
}
.fwd-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.fwd-preview-bubble {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 12px; color: var(--text-secondary);
  white-space: pre-wrap; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.fwd-search {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: rgba(255,255,255,0.06);
  color: var(--text); font-size: 13px; font-family: var(--font-display); outline: none;
}
.fwd-search:focus { border-color: rgba(var(--accent-rgb,35,87,232),0.4); }
.fwd-contacts-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: none;
}
.fwd-contacts-list::-webkit-scrollbar { display: none; }
.fwd-contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer;
  transition: all 120ms var(--ease);
}
.fwd-contact-item:hover { background: rgba(var(--accent-rgb,35,87,232),0.07); border-color: rgba(var(--accent-rgb,35,87,232),0.15); }
.fwd-contact-item.selected { background: rgba(var(--accent-rgb,35,87,232),0.12); border-color: rgba(var(--accent-rgb,35,87,232),0.3); }
.fwd-contact-av {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2, #06b6d4));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: white; overflow: hidden;
}
.fwd-contact-av img { width: 100%; height: 100%; object-fit: cover; }
.fwd-contact-name { font-size: 13px; font-weight: 700; color: var(--text); }
.fwd-contact-skill { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.fwd-contact-check {
  margin-left: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 120ms var(--ease);
}
.fwd-contact-item.selected .fwd-contact-check {
  background: var(--accent); border-color: var(--accent);
}
.fwd-send-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark, #1a44c8));
  border: none; color: white; font-size: 14px; font-weight: 800;
  font-family: var(--font-display); cursor: pointer;
  transition: all 150ms var(--ease); display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 4px 20px rgba(35,87,232,0.3);
}
.fwd-send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(35,87,232,0.5); }
.fwd-send-btn:disabled { opacity: 0.4; pointer-events: none; }

#kbd-hint-panel {
  position: fixed; bottom: 72px; right: 16px; z-index: 1500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  width: min(260px, calc(100vw - 32px));
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.96);
  transition: all 180ms var(--ease);
}
#kbd-hint-panel.show { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }
.kbd-hint-title {
  font-size: 11px; font-family: var(--font-mono); letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.kbd-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0; font-size: 12px; color: var(--text-secondary);
}
.kbd-key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 5px;
  background: rgba(255,255,255,0.11); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 4px; font-family: var(--font-mono); font-size: 10px;
  color: var(--text); font-weight: 700; letter-spacing: 0px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

.ups-mutual-pill {
  display: none;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7; font-size: 10px; font-weight: 700;
  font-family: var(--font-mono); gap: 4px; align-items: center;
}
.ups-mutual-pill.show { display: inline-flex; }
.ups-posts-section { padding-bottom: 24px; }
.ups-posts-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ups-posts-title {
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; gap: 6px;
}
.ups-posts-subtitle { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.ups-posts-list { display: flex; flex-direction: column; gap: 8px; }
.ups-post-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}
.ups-post-card:hover { border-color: rgba(35, 87, 232, 0.25); background: rgba(35, 87, 232, 0.10); }

.portfolio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.2s var(--ease);
  position: relative;
}
.portfolio-card:hover { border-color: var(--border-hover); }
.portfolio-card-title { font-size:14px; font-weight:800; color:var(--text); margin-bottom:4px; }
.portfolio-card-desc  { font-size:12px; color:var(--text-secondary); line-height:1.5; margin-bottom:8px; }
.portfolio-card-link  { font-size:11px; color:var(--accent-light); text-decoration:none; word-break:break-all; }
.portfolio-card-link:hover { text-decoration:underline; }
.portfolio-card-tags  { display:flex; gap:5px; flex-wrap:wrap; margin-top:8px; }
.portfolio-card-tag   { font-size:10px; font-family:var(--font-mono); background:rgba(35, 87, 232, 0.1); color:var(--accent-light); border-radius:var(--radius-pill); padding:2px 7px; }
.portfolio-card-actions { position:absolute; top:8px; right:10px; display:flex; gap:6px; }
.portfolio-card-edit-btn, .portfolio-card-del-btn {
  background:none; border:none; font-size:12px; cursor:pointer; padding:2px 5px; border-radius:var(--radius-xs); color:var(--muted);
}
.portfolio-card-edit-btn:hover { color:var(--accent-light); }
.portfolio-card-del-btn:hover  { color:var(--danger); }
.ups-tab-btn.active { color:var(--text) !important; border-bottom-color:var(--accent) !important; }
.ups-post-card-content {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ups-post-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; color: var(--muted); font-family: var(--font-mono);
}
.ups-post-card-tag {
  padding: 2px 7px; border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.1); color: var(--accent-light);
  font-size: 9px; font-weight: 700;
}
.ups-no-posts {
  text-align: center; padding: 28px 16px;
  color: var(--muted); font-size: 12px;
  font-family: var(--font-mono);
}
.ups-posts-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 20px; color: var(--muted); font-size: 12px;
  font-family: var(--font-mono); gap: 8px;
}

.info-quick-panel {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: var(--panel-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 6px;
  min-width: 200px;
  z-index: var(--z-dropdown);
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease), opacity 0.18s var(--ease);
  transform-origin: top right;
}
.info-quick-panel.open {
  opacity: 1; pointer-events: all;
  transform: translateY(0) scale(1);
}
.iqp-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; font-family: var(--font-display);
  color: var(--text-secondary); cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.12s, opacity 0.12s; border: none; background: none;
  width: 100%; text-align: left; outline: none;
}
.iqp-item:hover { background: rgba(35, 87, 232, 0.08); color: var(--text); }
.iqp-item.danger { color: rgba(239,68,68,0.7); }
.iqp-item.danger:hover { background: rgba(239,68,68,0.08); color: var(--danger-light); }
.iqp-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 4px 0; }
@media (min-width: 600px) and (max-width: 1023px) {
  #user-list-screen { padding: 20px 24px 12px; }
  .screen { padding: 28px 28px; }
  #chat-screen, #explore-screen, #downloads-screen, #create-screen { padding: 0; }
  .user-top { flex-direction: column; align-items: flex-start; gap: 2px; row-gap: 0; }
  .user-name { max-width: 100%; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .badge { font-size: 8px; padding: 2px 6px; }
}

@media (max-width: 599px) {
  .desktop-sidebar,
  .desktop-main {
    display: contents;
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }

.endorse-section { margin-top: 8px; }
.endorse-btn {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(35, 87, 232, 0.08); border: 1px solid rgba(35, 87, 232, 0.2);
  color: var(--accent-light); font-size: 12px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.endorse-btn:hover { background: rgba(35, 87, 232, 0.18); border-color: rgba(35, 87, 232, 0.45); transform: translateY(-1px); }
.endorse-btn:disabled { opacity: 0.4; pointer-events: none; }
.endorse-btn.endorsed { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--success-light); }
.endorse-count-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: var(--radius-xs); margin-top: 6px;
}
.endorse-count-label { font-size: 11px; font-family: var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.endorse-count-val { font-size: 15px; font-weight: 800; color: var(--accent3-light); font-family: var(--font-mono); }

#confirm-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.65); display: none; align-items: center; justify-content: center;
  animation: fadeIn var(--duration-fast) var(--ease);
}
#confirm-modal-overlay.active { display: flex; }
.confirm-modal-box {
  background: rgba(20, 18, 16, 0.98); border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl); padding: 28px 28px 22px;
  width: min(360px, 90vw); box-shadow: var(--shadow-lg);
  animation: scaleIn var(--duration-normal) var(--ease-spring);
  display: flex; flex-direction: column; gap: 12px;
}
.confirm-modal-icon { font-size: 32px; text-align: center; }
.confirm-modal-title { font-size: 16px; font-weight: 800; text-align: center; color: var(--text); }
.confirm-modal-sub { font-size: 13px; color: var(--text-secondary); text-align: center; line-height: 1.55; }
.confirm-modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.confirm-modal-cancel {
  flex: 1; padding: 11px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.confirm-modal-cancel:hover { background: rgba(255,255,255,0.16); border-color: var(--border-hover); }
.confirm-modal-confirm {
  flex: 1; padding: 11px; border-radius: var(--radius-md);
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.4);
  color: var(--danger-light); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.confirm-modal-confirm:hover { background: rgba(239,68,68,0.28); border-color: rgba(239,68,68,0.65); }
.confirm-modal-confirm.primary-action {
  background: rgba(35, 87, 232, 0.15); border-color: rgba(35, 87, 232, 0.4);
  color: var(--accent-light);
}
.confirm-modal-confirm.primary-action:hover { background: rgba(35, 87, 232, 0.28); }

.match-score-badge {
  font-size: 12px; line-height: 1;
  width: 20px; height: 20px; border-radius: 50%;
  font-weight: 700; flex-shrink: 0;
  border: 1px solid transparent; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
.match-score-badge.high {
  background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3);
  color: var(--success-light);
}
.match-score-badge.med {
  background: rgba(35, 87, 232, 0.1); border-color: rgba(35, 87, 232, 0.25);
  color: var(--accent-light);
}
.match-score-badge.low { display: none; }

#report-modal-overlay {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease), visibility 0ms calc(var(--duration-fast) + 10ms);
}
#report-modal-overlay.active { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity var(--duration-fast) var(--ease), visibility 0ms 0ms; }
.report-modal-box {
  background: rgba(20,18,16,0.99); border: 1px solid rgba(239,68,68,0.28);
  border-radius: var(--radius-xl); padding: 26px 24px 22px;
  width: min(380px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(239,68,68,0.06);
  animation: scaleIn var(--duration-normal) var(--ease-spring);
  display: flex; flex-direction: column; gap: 14px;
}
.report-modal-head {
  display: flex; align-items: center; gap: 10px;
}
.report-modal-head-icon { font-size: 24px; flex-shrink: 0; }
.report-modal-head-text .report-modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.report-modal-head-text .report-modal-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.report-reasons { display: flex; flex-direction: column; gap: 6px; }
.report-reason-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  text-align: left; color: var(--text-secondary); font-size: 13px;
  font-family: var(--font-display); font-weight: 600; cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease); outline: none;
  display: flex; align-items: center; gap: 8px;
}
.report-reason-btn:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.3); color: var(--danger-light); }
.report-reason-btn.selected { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.5); color: var(--danger-light); }
.report-detail-wrap { display: none; flex-direction: column; gap: 5px; }
.report-detail-wrap.visible { display: flex; }
.report-detail-wrap label { font-size: 10px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.report-modal-actions { display: flex; gap: 10px; padding-top: 2px; }
.report-modal-cancel-btn {
  flex: 1; padding: 11px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none;
}
.report-modal-cancel-btn:hover { background: rgba(255,255,255,0.16); border-color: var(--border-hover); }
.report-modal-submit-btn {
  flex: 1.4; padding: 11px; border-radius: var(--radius-md);
  background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.4);
  color: var(--danger-light); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none;
}
.report-modal-submit-btn:hover { background: rgba(239,68,68,0.26); border-color: rgba(239,68,68,0.65); }
.report-modal-submit-btn:disabled { opacity: 0.38; pointer-events: none; }

#feedback-modal-overlay {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease), visibility 0ms calc(var(--duration-fast) + 10ms);
}
#feedback-modal-overlay.active { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity var(--duration-fast) var(--ease), visibility 0ms 0ms; }
.feedback-modal-box {
  background: rgba(20,18,16,0.99); border: 1px solid rgba(35, 87, 232, 0.22);
  border-radius: var(--radius-xl); padding: 28px 24px 22px;
  width: min(380px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(35, 87, 232, 0.14);
  animation: scaleIn var(--duration-normal) var(--ease-spring);
  display: flex; flex-direction: column; gap: 16px; text-align: center;
}
.feedback-modal-emoji { font-size: 36px; line-height: 1; }
.feedback-modal-title { font-size: 17px; font-weight: 800; color: var(--text); }
.feedback-modal-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: -8px; }
.feedback-stars {
  display: flex; justify-content: center; gap: 10px; padding: 4px 0;
}
.feedback-star {
  font-size: 34px; cursor: pointer; user-select: none;
  filter: grayscale(1) opacity(0.3); line-height: 1;
  transition: color 150ms var(--ease-spring), background 150ms var(--ease-spring), border-color 150ms var(--ease-spring), box-shadow 150ms var(--ease-spring), transform 150ms var(--ease-spring), opacity 150ms var(--ease-spring);
}
.feedback-star:hover, .feedback-star.lit { filter: grayscale(0) opacity(1); transform: scale(1.2); }
.feedback-rating-label {
  font-size: 12px; font-family: var(--font-mono); color: var(--accent-light);
  letter-spacing: 1px; min-height: 18px; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.feedback-msg-field { text-align: left; display: flex; flex-direction: column; gap: 5px; }
.feedback-msg-field label { font-size: 10px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.feedback-modal-actions { display: flex; gap: 10px; }
.feedback-modal-cancel-btn {
  flex: 1; padding: 11px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none;
}
.feedback-modal-cancel-btn:hover { background: rgba(255,255,255,0.16); border-color: var(--border-hover); }
.feedback-modal-submit-btn {
  flex: 2; padding: 11px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; color: white; font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); outline: none;
  box-shadow: 0 4px 16px var(--glow-accent);
}
.feedback-modal-submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.feedback-modal-submit-btn:disabled { opacity: 0.35; pointer-events: none; transform: none; box-shadow: none; }

.report-user-btn {
  width: 100%; padding: 9px 14px; border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.18);
  color: rgba(239,68,68,0.7); font-size: 12px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; outline: none;
}
.report-user-btn:hover { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.4); color: var(--danger-light); }

.feedback-profile-btn {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(5, 150, 105, 0.07); border: 1px solid rgba(5, 150, 105, 0.2);
  color: var(--accent2-light); font-size: 13px; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: flex; align-items: center; justify-content: center; gap: 7px; outline: none; margin-bottom: -4px;
}
.feedback-profile-btn:hover { background: rgba(5, 150, 105, 0.15); border-color: rgba(5, 150, 105, 0.4); }

.create-share-type-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.create-share-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  outline: none;
}
.create-share-type-btn.active {
  background: rgba(35, 87, 232, 0.15);
  border-color: rgba(35, 87, 232, 0.5);
  color: var(--accent-light);
  box-shadow: 0 0 12px rgba(35, 87, 232, 0.12);
}
.create-share-type-btn:not(.active):hover {
  border-color: rgba(35, 87, 232, 0.25);
  color: var(--text-secondary);
}

.content-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 480px) {
  .content-type-grid { grid-template-columns: repeat(6, 1fr); }
}
.content-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  outline: none;
  user-select: none;
}
.content-type-btn:hover {
  border-color: rgba(35, 87, 232, 0.3);
  background: rgba(35, 87, 232, 0.14);
  color: var(--text);
  transform: translateY(-1px);
}
.content-type-btn.active {
  background: rgba(35, 87, 232, 0.18);
  border-color: rgba(35, 87, 232, 0.55);
  color: var(--accent-light);
  box-shadow: 0 0 16px rgba(35, 87, 232, 0.14);
}
.content-type-icon { font-size: 20px; line-height: 1; }
.content-type-label { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }

.create-panel {
  animation: fadeUp var(--duration-normal) var(--ease) both;
}

.create-audio-zone {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.create-record-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  border-radius: var(--radius-lg);
  background: rgba(35, 87, 232, 0.12);
  border: 2px solid rgba(35, 87, 232, 0.28);
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  outline: none;
  min-width: 140px;
}
.create-record-btn:hover {
  background: rgba(35, 87, 232, 0.22);
  border-color: rgba(35, 87, 232, 0.6);
  transform: scale(1.02);
}
.create-record-btn.recording {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.5);
  color: var(--danger-light);
  animation: recordPulse 1.5s ease-in-out infinite;
}
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
.create-rec-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--danger-light);
}
.create-rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.create-audio-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.create-audio-divider::before, .create-audio-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.create-upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(5, 150, 105, 0.06);
  border: 1px dashed rgba(5, 150, 105, 0.25);
  color: var(--accent2-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  width: 100%;
  text-align: center;
  justify-content: center;
}
.create-upload-label:hover {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.5);
}
.create-file-zone {
  flex-direction: column;
  padding: 20px;
  gap: 10px;
}

.create-link-preview {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
}
.link-preview-inner {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.link-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-preview-url {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(5, 150, 105, 0.06);
  border: 1px solid rgba(5, 150, 105, 0.2);
}
.create-file-chip-icon { font-size: 22px; flex-shrink: 0; }
.create-file-chip-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.create-file-chip-size {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  flex-shrink: 0;
}
.create-file-chip-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--duration-fast);
  flex-shrink: 0;
}
.create-file-chip-remove:hover { color: var(--danger-light); }

.create-audio-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  padding: 6px 10px;
}
.create-audio-preview audio { width: 100%; height: 36px; }
.create-audio-clear {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 4px 8px;
  border-radius: 4px;
  transition: color var(--duration-fast);
  font-family: var(--font-display);
  font-weight: 700;
}
.create-audio-clear:hover { color: var(--danger-light); }

.create-preview-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
}
.create-preview-btn:hover {
  border-color: rgba(35, 87, 232, 0.35);
  color: var(--accent-light);
  background: rgba(35, 87, 232, 0.14);
}

.post-content-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid transparent;
  margin-left: 6px;
}
.post-content-type-badge.type-image {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.2);
  color: var(--accent2-light);
}
.post-content-type-badge.type-audio {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.2);
  color: var(--accent3-light);
}
.post-content-type-badge.type-file {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.2);
  color: var(--success-light);
}
.post-content-type-badge.type-link {
  background: rgba(35, 87, 232, 0.08);
  border-color: rgba(35, 87, 232, 0.2);
  color: var(--accent-light);
}

.post-audio-player {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.post-audio-wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
  transition: height 0.15s ease;
}
.post-audio-play-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  box-shadow: 0 2px 10px rgba(35, 87, 232, 0.3);
}
.post-audio-play-btn:hover { transform: scale(1.08); }
.post-audio-duration {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.post-link-embed {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.post-link-embed:hover { border-color: rgba(35, 87, 232, 0.35); }
.post-link-embed-inner { padding: 10px 12px; }
.post-link-embed-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.post-link-embed-url { font-size: 10px; font-family: var(--font-mono); color: var(--muted); }

.post-file-embed {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.15);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.post-file-embed:hover {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.3);
}
.post-file-embed-icon { font-size: 22px; flex-shrink: 0; }
.post-file-embed-info { flex: 1; min-width: 0; }
.post-file-embed-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-file-embed-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.post-file-embed-dl {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--success-light);
  font-weight: 700;
}

#explore-tab-people {}

.people-filter-row {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 16px 6px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.people-filter-row::-webkit-scrollbar { display: none; }
.people-skill-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease);
  outline: none;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  user-select: none;
  letter-spacing: 0.1px;
}
.people-skill-pill:hover {
  border-color: rgba(35, 87, 232, 0.45);
  color: var(--text);
  background: rgba(35, 87, 232, 0.06);
  box-shadow: 0 2px 8px rgba(35,87,232,0.12);
  transform: translateY(-1px);
}
.people-skill-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(35, 87, 232, 0.35);
  transform: translateY(-1px);
}
.people-skill-pill.active:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.people-results-wrap {
  flex: none;
  overflow: visible;
  padding: 8px 12px calc(var(--screen-pb) + 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.collab-match-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color 0.2s var(--ease);
}
.collab-match-card:hover { border-color: var(--border-hover); }
.collab-match-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; overflow: hidden;
}
.collab-match-avatar img { width: 100%; height: 100%; object-fit: cover; }
.collab-match-info { flex: 1; min-width: 0; cursor: pointer; }
.collab-match-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collab-match-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.collab-match-goal-tag {
  display: inline-block; font-size: 10px; font-family: var(--font-mono);
  background: rgba(35, 87, 232, 0.12); color: var(--accent-light);
  border-radius: var(--radius-pill); padding: 2px 7px; margin-left: 4px;
}
.collab-match-msg-btn {
  flex-shrink: 0; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-xs); padding: 5px 11px;
  font-size: 11px; font-weight: 700; font-family: var(--font-display);
  cursor: pointer; transition: opacity 0.15s;
}
.collab-match-msg-btn:hover { opacity: 0.85; }
#collab-matches-list {
  max-height: min(32vh, 240px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
#collab-matches-list::-webkit-scrollbar { width: 4px; }
#collab-matches-list::-webkit-scrollbar-thumb {
  background: rgba(35, 87, 232, 0.2);
  border-radius: 4px;
}

.people-card {
  contain: layout;
  content-visibility: auto;
  contain-intrinsic-size: 0 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  animation: fadeUp var(--duration-slow) var(--ease) both;
  position: relative;
  overflow: hidden;
}
.people-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.03), transparent);
  pointer-events: none;
}
.people-card:hover {
  border-color: rgba(35, 87, 232, 0.3);
  background: rgba(35, 87, 232, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(35, 87, 232, 0.08);
}
.people-card:active { transform: translateY(0); }

.people-card-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.25), rgba(5, 150, 105, 0.15));
  border: 2px solid rgba(35, 87, 232, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-light);
  overflow: hidden;
  position: relative;
}
.people-card-avatar.online::after {
  content: '';
  position: absolute; bottom: 2px; right: 1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 1.5px solid var(--panel-solid);
}
.people-card-avatar img { width: 100%; height: 100%; object-fit: cover; }

.people-card-body { flex: 1; min-width: 0; }
.people-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people-card-skill {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.people-card-skill-badge {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.08);
  border: 1px solid rgba(35, 87, 232, 0.15);
  color: var(--accent-light);
  font-size: 10px;
  font-weight: 700;
}
.people-card-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.people-card-tag {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.people-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.people-card-level {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}
.people-card-pts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent3-light);
  font-weight: 700;
}
.people-card-follow-btn {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(35, 87, 232, 0.35);
  background: rgba(35, 87, 232, 0.08);
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
  white-space: nowrap;
}
.people-card-follow-btn:hover {
  background: rgba(35, 87, 232, 0.2);
  border-color: rgba(35, 87, 232, 0.6);
}
.people-card-follow-btn.following {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.3);
  color: var(--success-light);
}

html[data-theme="dev"] .people-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.07);
}
html[data-theme="dev"] .people-card:hover {
  background: rgba(29, 155, 240, 0.10);
  border-color: rgba(29, 155, 240, 0.24);
}
html[data-theme="dev"] .people-card-level {
  background: rgba(255, 255, 255, 0.06);
}

.people-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.people-results-loading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.people-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 2px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.people-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

#people-panel {
  overflow: visible;
}

#explore-main-title {
  transition: opacity var(--duration-fast) var(--ease);
}

@media (max-width: 599px) {
  input, textarea, select { font-size: max(16px, 1em) !important; }

  .screen {
    padding: 14px 14px;
  }

  #main-nav {
    padding: 3px 2px 8px;
    gap: 0;
  }
  .nav-btn {
    min-width: 44px;
    padding: 6px 7px 5px;
    gap: 2px;
    border-radius: var(--radius-xs);
  }
  .nav-btn .nav-icon {
    font-size: 19px;
  }
  .nav-btn .nav-label {
    font-size: 8px;
    letter-spacing: 0.2px;
  }
  .nav-btn.create-btn {
    padding: 7px 13px;
    margin: -1px 0;
    gap: 5px;
  }

  #stories-scroll {
    padding: 5px 10px 5px;
    gap: 8px;
  }
  .story-bubble {
    width: 42px;
    height: 42px;
  }
  .story-bubble-inner {
    font-size: 13px;
  }
  .story-add-inner {
    font-size: 17px;
  }
  .story-label {
    font-size: 7.5px;
    max-width: 42px;
    letter-spacing: 0;
  }

  .explore-top {
    padding: 6px 10px 0;
  }
  .explore-top-row {
    margin-bottom: 5px;
    gap: 6px;
  }

  .explore-top-row h2 {
    display: none;
  }

  .explore-top-row .explore-search-wrap input {
    font-size: 13px;
    padding: 7px 10px 7px 27px;
  }
  .explore-top-row .explore-search-wrap::before {
    font-size: 13px;
    left: 8px;
  }

  .explore-top-row .feed-sort-btn {
    font-size: 10px;
    padding: 5px 7px;
  }

  .explore-filters {
    padding: 2px 0 7px;
    gap: 5px;
  }
  .filter-pill {
    padding: 5px 12px;
    font-size: 11.5px;
    border-radius: var(--radius-pill);
  }

  .explore-tab-bar {
    padding: 0;
  }
  .explore-tab {
    font-size: 10px;
    padding: 5px 10px;
    letter-spacing: 0.2px;
  }

  #posts-feed {
    padding: 6px 8px 68px;
  }

  .communities-top {
    padding: 8px 12px 0;
  }
  .communities-top-row {
    gap: 7px;
    margin-bottom: 7px;
    align-items: center;
  }

  .communities-top-row h2 {
    display: none;
  }

  .communities-search {
    font-size: 13px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
  }

  .community-create-btn {
    font-size: 11px;
    padding: 7px 11px;
  }

  .communities-filter-row {
    gap: 5px;
    padding-bottom: 5px;
  }

  .communities-toggle-row {
    padding: 2px 0 6px;
    gap: 5px;
  }
  .comm-toggle-btn {
    font-size: 11px;
    padding: 5px 12px;
  }

  #communities-list {
    padding: 0 12px 68px;
    gap: 7px;
  }
  .community-card {
    padding: 11px 12px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .rooms-top {
    padding: 10px 14px 8px;
  }
  .rooms-top-row {
    margin-bottom: 8px;
  }
  .rooms-top-title {
    font-size: 15px;
  }
  .rooms-create-btn {
    font-size: 11px;
    padding: 7px 12px;
    gap: 5px;
  }

  .room-card {
    padding: 11px 14px;
    margin: 0 8px 5px;
  }
  .room-card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .rooms-section-label {
    margin: 0 14px 6px;
    padding-top: 10px;
  }

  .rooms-list-wrap {
    padding-bottom: 68px;
  }

  .room-create-topbar {
    padding: 10px 14px;
    gap: 10px;
  }
  .room-create-body {
    padding: 18px 14px 90px;
  }
  .room-submit-wrap {
    padding: 12px 16px 20px;
  }
  .room-chat-topbar {
    padding: 9px 12px;
    gap: 8px;
  }

  .dir-header {
    margin-bottom: 10px;
  }
  .dir-title {
    font-size: 19px;
  }
  .dir-count {
    font-size: 10px;
  }

  .search-wrap {
    margin-bottom: 7px;
  }
  .search-wrap .input {
    padding-left: 34px;
    font-size: 13px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .search-icon {
    left: 12px;
    font-size: 12px;
  }

  .filter-row {
    gap: 6px;
    margin-bottom: 9px;
  }
  .filter-row .input {
    font-size: 12px;
    padding: 8px 28px 8px 10px;
  }
  .toggle-pill {
    font-size: 11px;
    padding: 0 9px;
    height: 36px;
  }

  .user-item {
    padding: 10px 11px;
    gap: 10px;
    margin-bottom: 5px;
  }
  .user-avatar {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
  .user-name {
    font-size: 13px;
  }
  .user-preview {
    font-size: 11px;
  }

  #recs-wrap {
    margin-bottom: 10px;
  }
  .rec-card {
    min-width: 106px;
    padding: 10px 12px;
  }

  .guild-header {
    padding: 6px 12px;
    gap: 7px;
  }
  .guild-header-icon {
    font-size: 16px;
  }
  .guild-header-name {
    font-size: 12px;
  }
  .guild-member-count {
    font-size: 9px;
    padding: 2px 6px;
  }

  .guild-msg {
    padding: 2px 12px;
  }

  .guild-input-area {
    padding: 7px 10px 11px;
    gap: 5px;
  }
  .guild-input-area .input {
    font-size: 14px;
    padding: 8px 12px;
  }
  .guild-input-area .icon-btn {
    width: 33px;
    height: 33px;
  }
  .guild-send-btn {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .chat-topbar {
    padding: 9px 12px;
    gap: 9px;
  }
  .back-btn {
    padding: 7px 10px;
    font-size: 14px;
  }
  .icon-btn {
    padding: 7px 9px;
  }
  #msgs-wrap {
    padding: 10px 12px 16px;
    gap: 5px;
  }

  .content-type-btn {
    padding: 10px 4px;
  }
  .content-type-icon {
    font-size: 18px;
  }
  .content-type-label {
    font-size: 9px;
  }

  .people-filter-row {
    padding: 6px 10px 5px;
    gap: 5px;
  }
  .people-skill-pill {
    font-size: 10.5px;
    padding: 4px 10px;
  }

  .post-card {
    padding: 12px 11px 10px;
    margin-bottom: 7px;
    border-radius: var(--radius-md);
  }

  #profile-modal {
    padding: 0;
  }

  #notif-list {
    padding: 8px 10px;
  }
  .notif-item {
    padding: 11px 12px;
    gap: 10px;
  }

}

@media (max-width: 399px) {

  .nav-btn {
    min-width: 38px;
    padding: 5px 5px 4px;
  }
  .nav-btn .nav-icon {
    font-size: 18px;
  }
  .nav-btn .nav-label {
    font-size: 7px;
  }
  .nav-btn.create-btn {
    padding: 6px 9px;
  }

  #stories-scroll {
    padding: 4px 8px 4px;
    gap: 7px;
  }
  .story-bubble {
    width: 36px;
    height: 36px;
  }
  .story-bubble-inner {
    font-size: 11px;
  }
  .story-label {
    font-size: 7px;
    max-width: 36px;
  }

  .explore-top {
    padding: 4px 8px 0;
  }
  .explore-tab {
    font-size: 9.5px;
    padding: 4px 8px;
  }
  .filter-pill {
    padding: 3px 8px;
    font-size: 10px;
  }
  .explore-top-row .feed-sort-btn {
    font-size: 9.5px;
    padding: 4px 5px;
  }

  .communities-top {
    padding: 6px 10px 0;
  }
  .communities-search {
    font-size: 12px;
    padding: 6px 9px;
  }
  .community-create-btn {
    font-size: 10px;
    padding: 6px 9px;
  }
  .comm-toggle-btn {
    font-size: 10px;
    padding: 4px 10px;
  }

  .rooms-top {
    padding: 8px 12px 6px;
  }
  .rooms-top-title {
    font-size: 14px;
  }
  .rooms-create-btn {
    font-size: 10px;
    padding: 6px 10px;
  }
  .room-card {
    padding: 10px 12px;
    margin: 0 6px 5px;
  }

  .dir-title {
    font-size: 17px;
  }
  .filter-row {
    flex-wrap: wrap;
  }
  .filter-row .input {
    font-size: 11px;
    padding: 7px 24px 7px 9px;
  }
  .user-item {
    padding: 9px 10px;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .post-card {
    padding: 10px 10px 9px;
  }
}

.room-card:hover {
  border-color: rgba(35, 87, 232, 0.30) !important;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(35, 87, 232, 0.10) !important;
  transform: translateY(-2px) !important;
}

.room-type-card.selected {
  border-color: rgba(35, 87, 232, 0.45) !important;
  background: rgba(35, 87, 232, 0.07) !important;
  box-shadow: 0 0 20px rgba(35, 87, 232, 0.14) !important;
}

.user-item {
  padding: 12px 14px !important;
  gap: 12px !important;
}
.user-item:hover {
  box-shadow: var(--shadow-sm) !important;
}

.nav-btn.active {
  background: rgba(35, 87, 232, 0.10) !important;
  box-shadow: 0 0 14px rgba(35, 87, 232, 0.16) !important;
}
.nav-btn.active .nav-icon {
  filter: drop-shadow(0 0 6px rgba(35, 87, 232, 0.45));
}

.nav-btn {
  gap: 6px !important;
  padding: 10px 6px !important;
}

.post-card {
  box-shadow: var(--shadow-sm) !important;
  border-color: var(--border) !important;
  transition: box-shadow var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease) !important;
}
.post-card:hover {
  box-shadow: var(--shadow-md) !important;
  border-color: rgba(35, 87, 232, 0.22) !important;
  transform: translateY(-1px) !important;
}

.rec-card {
  box-shadow: var(--shadow-sm) !important;
}
.rec-card:hover {
  box-shadow: var(--shadow-md) !important;
  border-color: rgba(35, 87, 232, 0.24) !important;
  transform: translateY(-2px) !important;
}

.login-emblem {
  box-shadow: 0 0 48px rgba(35, 87, 232, 0.18), inset 0 0 32px rgba(35, 87, 232, 0.06), var(--shadow-lg) !important;
}

.avatar-btn {
  box-shadow: 0 0 16px rgba(35, 87, 232, 0.20) !important;
  transition: box-shadow var(--duration-normal) var(--ease), border-color var(--duration-normal) var(--ease) !important;
}
.avatar-btn:hover {
  box-shadow: 0 0 28px rgba(35, 87, 232, 0.36) !important;
}

.chat-empty-icon {
  box-shadow: 0 0 48px rgba(35, 87, 232, 0.12), inset 0 0 28px rgba(35, 87, 232, 0.05), var(--shadow-md) !important;
}

#scroll-bottom-btn {
  box-shadow: var(--shadow-accent) !important;
}

.starter:hover {
  box-shadow: 0 4px 16px rgba(35, 87, 232, 0.16) !important;
  border-color: rgba(35, 87, 232, 0.30) !important;
}

.skill-select-pill {
  padding: 8px 18px !important;
}

#profile-modal {
  box-shadow: var(--shadow-lg) !important;
}

#user-profile-sheet > .inner {
  box-shadow: var(--shadow-lg) !important;
}

.rooms-create-btn {
  padding: 10px 18px !important;
  box-shadow: 0 4px 20px rgba(35, 87, 232, 0.28) !important;
  border-radius: var(--radius-md) !important;
}
.rooms-create-btn:hover {
  box-shadow: 0 8px 28px rgba(35, 87, 232, 0.38) !important;
  transform: translateY(-2px) !important;
}

.btn-sm {
  border-radius: var(--radius-sm) !important;
}

html:not([data-theme="dev"]) body::before {
  background: radial-gradient(ellipse at 40% 0%, rgba(35, 87, 232, 0.07), transparent 60%),
              radial-gradient(ellipse at 80% 100%, rgba(5, 150, 105, 0.04), transparent 55%) !important;
}

.desktop-sidebar {
  border-right-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06) !important;
}

.screen-topbar,
.explore-topbar,
.guild-topbar,
.rooms-top,
.chat-topbar,
.room-chat-topbar,
.room-create-topbar {
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
}

:root {
  --bg: #D8E0EF;            /* Was #EEF2F8 — deeper, more atmosphere */
  --surface: #FFFFFF;       /* Stays white — now clearly floats above bg */
  --panel: rgba(255, 255, 255, 0.96);
}

body::before {
  background:
    radial-gradient(ellipse at 20% 0%,   rgba(35, 87, 232, 0.18), transparent 55%),
    radial-gradient(ellipse at 85% 90%,  rgba(5, 150, 105, 0.08), transparent 50%),
    radial-gradient(ellipse at 55% 50%,  rgba(79, 70, 229, 0.05), transparent 65%) !important;
}

body::after {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    radial-gradient(circle at 1px 1px, rgba(35, 87, 232, 0.09) 1px, transparent 0) 0 0 / 28px 28px !important;
  opacity: 0.55 !important;
}

.screen-topbar-title,
.explore-topbar-title,
.guild-topbar-title,
.rooms-top-title,
.chat-topbar-title,
.room-chat-topbar-title,
.room-create-topbar-title,
.notif-detail-header-title,
.section-title,
.modal-title,
h1, h2 {
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
}

.user-name,
.room-card-name,
.rec-name,
.rooms-card-name,
.post-author-name,
.ups-name,
.level-card-name,
.room-admin-panel-title,
.portfolio-modal-title {
  font-size: 15px !important;
  font-weight: 700 !important;
}

.user-bio,
.room-card-desc,
.rec-bio,
.rooms-card-meta,
.post-content,
.post-text,
.notif-item-text,
.rooms-empty-text,
.ups-bio {
  font-size: 13px !important;
  line-height: 1.55 !important;
}

.section-label,
.rec-skill,
.nav-btn .nav-label,
.ups-stat-lbl,
.room-card-skill,
.post-time,
.rooms-card-skill {
  font-size: 10px !important;
  letter-spacing: 0.6px !important;
}

.nav-btn.active {
  color: var(--accent) !important;
  background: transparent !important;
  box-shadow: none !important;
  position: relative !important;
}

.nav-btn.active::before {
  content: '' !important;
  position: absolute !important;
  top: 0px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 24px !important;
  height: 3px !important;
  border-radius: 0 0 3px 3px !important;
  background: var(--accent) !important;
  box-shadow: 0 0 10px rgba(35, 87, 232, 0.55) !important;
  animation: navPillIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

.nav-btn.active .nav-icon {
  filter: drop-shadow(0 0 7px rgba(35, 87, 232, 0.50)) !important;
  transform: translateY(-1px) !important;
}

.nav-btn.active .nav-label {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

.nav-btn.create-btn::before {
  display: none !important;
}

@keyframes navPillIn {
  from { width: 4px; opacity: 0; }
  to   { width: 24px; opacity: 1; }
}

.nav-btn:not(.active):hover {
  color: var(--text) !important;
  background: rgba(35, 87, 232, 0.07) !important;
}

html[data-theme="dev"] .nav-btn.active::before {
  background: var(--accent) !important;
  box-shadow: 0 0 12px rgba(29, 155, 240, 0.60) !important;
}

.screen {
  padding: var(--content-py) var(--content-px);
}

@media (min-width: 600px) and (max-width: 767px) {
  .nav-btn { min-width: 52px; }
  .nav-btn .nav-label { display: block; font-size: 8px; letter-spacing: 0; text-transform: none; }
}

#scroll-bottom-btn {
  bottom: calc(var(--nav-h) + 8px);
}
@media (min-width: 768px) {
  #scroll-bottom-btn { bottom: 80px; }
}

.post-image {
  max-height: clamp(180px, 30vw, 340px);
}
@media (min-width: 1024px) {
  .post-image { max-height: clamp(200px, 25vw, 360px); }
}

.guild-msg-body {
  max-width: min(72vw, clamp(280px, 55%, 440px));
}

@media (min-width: 768px) {
  .onboard-step {
    max-width: 480px;
    align-self: center;
    width: 100%;
  }
  .skill-card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .rooms-list-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0;
    padding: 12px;
  }
  .room-card {
    margin: 4px;
  }
  .rooms-section-label {
    grid-column: 1 / -1;
    margin: 0 4px 4px;
  }
}

#posts-feed {
  padding-left: var(--content-px);
  padding-right: var(--content-px);
}

@media (min-width: 1024px) {
  .dir-header { margin-bottom: 16px; }
  .dir-title { font-size: clamp(18px, 2vw, 24px); }
}

.chat-topbar {
  padding-top: max(10px, var(--safe-top));
}
.chat-input-area {
  padding-bottom: max(12px, var(--safe-bottom));
}

.guild-header {
  padding-top: max(7px, var(--safe-top));
}

.explore-top {
  padding-top: max(8px, var(--safe-top));
}

.rooms-top {
  padding-top: max(18px, var(--safe-top));
}

#notif-detail-sheet {
  padding-bottom: max(24px, var(--safe-bottom));
}
@media (min-width: 768px) {
  #notif-detail-sheet {
    max-width: min(560px, calc(100vw - 48px));
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  #notif-detail-sheet.open {
    transform: translateX(-50%) translateY(0);
  }
}

.confirm-modal-box {
  width: min(380px, calc(100vw - 32px));
}

.portfolio-modal-sheet {
  width: min(480px, calc(100vw - 32px));
  max-height: min(88dvh, 720px);
}

.loading-track {
  width: clamp(160px, 40vw, 240px);
}

@media (max-width: 599px) {
  .rec-card { min-width: 110px; padding: 10px 12px; }
}

.screen-topbar {
  padding-top: max(12px, var(--safe-top));
}

#profile-modal {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
  padding-bottom: max(20px, var(--safe-bottom));
}

@media (min-width: 1024px) {
  #saved-panel {
    width: min(420px, 35vw);
    border-left: 1px solid var(--border);
  }
}

@media (min-width: 1400px) {
  #posts-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
    align-items: start;
  }
  .feed-section-label,
  .skel-post-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .login-title { font-size: clamp(28px, 3vw, 36px); }
  .dir-title { font-size: clamp(20px, 1.8vw, 26px); }
  .onboard-welcome-brand { font-size: clamp(36px, 4vw, 52px); }
}

.notif-detail-drag-bar ~ *,
.portfolio-modal-sheet,
.ups-body {
  padding-bottom: max(20px, var(--safe-bottom));
}

@media (max-width: 399px) {
  .nav-btn.create-btn { padding: 6px 10px; }
  .nav-btn { padding: 6px 6px; min-width: 48px; }
}

#toast {
  max-width: calc(100vw - 32px - var(--sidebar-w));
}
@media (max-width: 767px) {
  #toast {
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    max-width: calc(100vw - 32px);
    bottom: calc(var(--nav-h) + 12px);
  }
  #toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .explore-top-row--single { padding: 0 20px; }
  #posts-feed { padding-left: 16px; padding-right: 16px; }
}

@media (min-width: 768px) {
  #scroll-bottom-btn {
    right: 24px;
    bottom: 24px;
  }
}

@media (min-width: 1024px) {
  #room-create-screen > *,
  #project-create-screen > * {
    max-width: 720px;
  }
}

@media (min-width: 768px) {
  html[data-theme="dev"] #user-list-screen {
    scrollbar-color: rgba(29,155,240,0.15) transparent;
  }
}

/* ============================================================
   GOLEX ELEGANCE & READABILITY SCALE-UP
   Goal: every touchable, readable element feels spacious and
   comfortable on all screen sizes — no squinting, no fat-finger
   misses, no text straining.
   ============================================================ */

/* ── 1. Root tokens: bigger nav, more breathing room ── */
:root {
  --nav-h: calc(68px + var(--safe-bottom));
  --screen-pb: calc(var(--nav-h) + 8px);
  --content-px: clamp(16px, 4.5vw, 28px);
  --content-py: clamp(16px, 3.5vh, 28px);
}

/* ── 2. Bottom nav bar: taller, roomier ── */
#main-nav {
  padding: 8px 6px !important;
  padding-bottom: calc(8px + var(--safe-bottom)) !important;
}

/* ── 3. Nav buttons: bigger icons, visible labels, generous tap target ── */
.nav-btn {
  gap: 4px !important;
  padding: 7px 10px !important;
  min-width: 56px !important;
  border-radius: 14px !important;
}
.nav-btn .nav-icon {
  font-size: 24px !important;
  width: 24px !important;
  height: 24px !important;
}
/* Show labels on mobile too */
.nav-btn .nav-label {
  display: block !important;
  font-size: 10px !important;
  letter-spacing: 0.3px !important;
}
/* Keep create button well-proportioned */
.nav-btn.create-btn {
  padding: 10px 18px !important;
  margin: -2px 0 !important;
}

/* ── 4. Inputs: 16px prevents iOS zoom, more padding = easier to type ── */
.input {
  padding: 14px 18px !important;
  font-size: 16px !important;
  border-radius: 14px !important;
}
textarea.input {
  min-height: 88px !important;
  padding: 14px 18px !important;
}
/* Field labels: slightly larger, easier to scan */
.field label {
  font-size: 11px !important;
  letter-spacing: 1.0px !important;
  margin-bottom: 6px !important;
}

/* ── 5. Buttons: more surface area for fingers ── */
.btn {
  padding: 16px 22px !important;
  font-size: 15px !important;
  border-radius: 15px !important;
}
.btn-sm {
  padding: 10px 18px !important;
  font-size: 14px !important;
  border-radius: 11px !important;
}

/* ── 6. Chrome / App bar ── */
.chrome {
  padding: 14px 18px 12px !important;
}
.chrome-logo {
  font-size: 17px !important;
  letter-spacing: 2.5px !important;
}

/* ── 7. Screen topbars: more height, breathing room ── */
.screen-topbar,
.explore-topbar,
.guild-topbar {
  padding: 14px 18px !important;
}
.screen-topbar-title,
.explore-topbar-title,
.guild-topbar-title {
  font-size: 19px !important;
  letter-spacing: -0.3px !important;
}

/* ── 8. User list items: bigger avatars & text ── */
.user-item {
  padding: 13px 16px !important;
  gap: 14px !important;
  margin-bottom: 7px !important;
}
.user-avatar {
  width: 48px !important;
  height: 48px !important;
  font-size: 17px !important;
  border-radius: 14px !important;
}
.user-name {
  font-size: 15px !important;
  font-weight: 700 !important;
}
.user-msg-preview,
.user-last-msg,
.user-sub {
  font-size: 13px !important;
  line-height: 1.45 !important;
}
.user-time {
  font-size: 11px !important;
}

/* ── 9. Chat topbar ── */
.chat-topbar {
  padding: 12px 16px !important;
  gap: 12px !important;
}
.chat-topbar .user-avatar {
  width: 40px !important;
  height: 40px !important;
}
.chat-topbar-name {
  font-size: 16px !important;
  font-weight: 700 !important;
}
.chat-topbar-sub {
  font-size: 12px !important;
}

/* ── 10. Chat messages: comfortable reading size ── */
.msg-bubble {
  font-size: 15px !important;
  padding: 11px 15px !important;
  line-height: 1.6 !important;
  border-radius: 18px !important;
}
.msg-bubble.edited::after {
  font-size: 11px !important;
}
.msg-time {
  font-size: 11px !important;
}
.msg-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
}

/* ── 11. Post cards: more spacious ── */
.post-card {
  padding: 16px !important;
  margin-bottom: 12px !important;
  border-radius: 18px !important;
}
.post-header {
  margin-bottom: 12px !important;
  gap: 12px !important;
}
.post-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
}
.post-username {
  font-size: 14px !important;
  font-weight: 700 !important;
}
.post-content {
  font-size: 15px !important;
  line-height: 1.65 !important;
  margin-bottom: 12px !important;
}
.post-skill-tag {
  font-size: 11px !important;
  padding: 3px 9px !important;
}
.post-tag {
  font-size: 12px !important;
  padding: 4px 11px !important;
}
.post-time,
.post-expiry {
  font-size: 11px !important;
}

/* ── 12. Post action buttons (like/reply bar) ── */
.post-actions {
  gap: 4px !important;
  padding-top: 10px !important;
}
.post-action-btn {
  font-size: 13px !important;
  padding: 7px 10px !important;
  gap: 5px !important;
  border-radius: 10px !important;
}

/* ── 13. Room cards ── */
.room-card {
  padding: 16px 20px !important;
  margin-bottom: 8px !important;
  gap: 14px !important;
}
.room-card-icon {
  width: 52px !important;
  height: 52px !important;
  font-size: 23px !important;
  border-radius: 15px !important;
}
.room-card-name {
  font-size: 15px !important;
  font-weight: 700 !important;
}
.room-card-desc {
  font-size: 13px !important;
}
.room-type-pill,
.room-entry-pill,
.rooms-my-badge {
  font-size: 10px !important;
  padding: 4px 9px !important;
}
.room-member-count {
  font-size: 11px !important;
}

/* ── 14. Notification items ── */
.notif-item {
  padding: 14px 18px !important;
  gap: 13px !important;
}
.notif-avatar {
  width: 46px !important;
  height: 46px !important;
  border-radius: 13px !important;
}
.notif-item-text {
  font-size: 14px !important;
  line-height: 1.5 !important;
}
.notif-time {
  font-size: 11px !important;
}

/* ── 15. Skill/filter pills ── */
.skill-select-pill {
  padding: 9px 18px !important;
  font-size: 13px !important;
}
.filter-pill,
.people-skill-pill {
  padding: 8px 16px !important;
  font-size: 13px !important;
}
.skill-tag {
  font-size: 12px !important;
  padding: 5px 12px !important;
}

/* ── 16. Icon buttons: bigger hit targets ── */
.icon-btn,
.back-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 11px !important;
}

/* ── 17. Modal / Profile sheet ── */
.modal-topbar {
  padding: 14px 18px !important;
}
.modal-topbar-title {
  font-size: 18px !important;
}
.modal-username,
.ups-name {
  font-size: 20px !important;
}
.modal-handle,
.ups-handle {
  font-size: 14px !important;
}
.modal-bio,
.ups-bio {
  font-size: 14px !important;
  line-height: 1.65 !important;
}
.stat-chip {
  padding: 10px 18px !important;
}
.stat-chip-num {
  font-size: 18px !important;
}
.stat-chip-lbl {
  font-size: 11px !important;
}

/* ── 18. Guild / Community screen ── */
.guild-header {
  padding: 10px 16px !important;
}
.guild-ch-name {
  font-size: 15px !important;
  font-weight: 700 !important;
}
.guild-msg-body {
  font-size: 15px !important;
  line-height: 1.6 !important;
}
.guild-msg-author {
  font-size: 13px !important;
  font-weight: 600 !important;
}
.guild-msg-time {
  font-size: 11px !important;
}

/* ── 19. Room create / Room topbar ── */
.room-create-topbar {
  padding: 15px 20px !important;
}
.room-create-topbar-title {
  font-size: 17px !important;
  font-weight: 800 !important;
}
.room-chat-topbar {
  padding: 13px 16px !important;
}
.room-chat-name {
  font-size: 16px !important;
  font-weight: 800 !important;
}
.room-chat-sub {
  font-size: 12px !important;
}

/* ── 20. Toast notification ── */
#toast {
  font-size: 14px !important;
  padding: 12px 22px !important;
  border-radius: 26px !important;
}

/* ── 21. Nova AI panel ── */
.nova-fab {
  width: 54px !important;
  height: 54px !important;
  font-size: 24px !important;
}
#nova-input {
  font-size: 15px !important;
  padding: 12px 16px !important;
}
.nova-msg {
  font-size: 14px !important;
  line-height: 1.6 !important;
  padding: 12px 16px !important;
}
.nova-send-btn,
#nova-send-btn {
  font-size: 18px !important;
  width: 40px !important;
  height: 40px !important;
}

/* ── 22. Sections labels: bump minimum so nothing is invisible ── */
.rooms-section-label,
.section-label {
  font-size: 11px !important;
  letter-spacing: 1.5px !important;
}

/* ── 23. Login screen: slightly bigger for impact ── */
.login-title {
  font-size: 34px !important;
}
.login-sub {
  font-size: 15px !important;
  max-width: 300px !important;
}
.tagline {
  font-size: 11px !important;
  padding: 6px 16px !important;
}
.login-emblem {
  width: 96px !important;
  height: 96px !important;
  font-size: 40px !important;
  border-radius: 28px !important;
}

/* ── 24. Desktop: sidebar nav items ── */
@media (min-width: 768px) {
  #main-nav {
    gap: 5px !important;
    padding: 12px 8px !important;
  }
  .nav-btn {
    padding: 11px 14px !important;
    border-radius: 12px !important;
  }
  .nav-btn .nav-icon {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
  }
  .nav-btn .nav-label {
    font-size: 13px !important;
  }
}

/* ── 25. Lucide icons in nav ── */
#main-nav .lucide,
#main-nav [data-lucide] {
  width: 24px !important;
  height: 24px !important;
}
@media (min-width: 768px) {
  #main-nav .lucide,
  #main-nav [data-lucide] {
    width: 20px !important;
    height: 20px !important;
  }
}

/* ── 26. Chat input bar ── */
#msg-input {
  font-size: 16px !important;
  padding: 10px 14px !important;
}
.chat-input-area {
  padding: 12px 14px !important;
  gap: 10px !important;
}
.chat-send-btn,
.voice-btn {
  width: 42px !important;
  height: 42px !important;
}

/* ── 27. Scroll-to-bottom button ── */
#scroll-bottom-btn {
  width: 44px !important;
  height: 44px !important;
  font-size: 22px !important;
}

/* ── 28. Rec / People discovery cards ── */
.rec-card {
  padding: 16px !important;
  gap: 13px !important;
  border-radius: 16px !important;
}
.rec-name {
  font-size: 15px !important;
  font-weight: 700 !important;
}
.rec-bio,
.rec-skill {
  font-size: 13px !important;
}
.rec-avatar {
  width: 50px !important;
  height: 50px !important;
  border-radius: 14px !important;
}

/* ── 29. Onboarding / setup screens ── */
.onboard-heading {
  font-size: 26px !important;
  line-height: 1.25 !important;
}
.onboard-sub {
  font-size: 15px !important;
  line-height: 1.65 !important;
}
.skill-card {
  padding: 14px !important;
  border-radius: 14px !important;
}
.skill-card-name {
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* ── 30. Smaller screen safety: ensure nothing shrinks below comfortable ── */
@media (max-width: 374px) {
  .btn {
    padding: 14px 18px !important;
    font-size: 14px !important;
  }
  .input {
    padding: 13px 16px !important;
    font-size: 16px !important;
  }
  .nav-btn {
    min-width: 48px !important;
    padding: 6px 7px !important;
  }
}


#notifications-screen { display: none !important; }
#delete-confirm-input-wrap {
  margin-top: 14px;
}
#delete-confirm-input-wrap label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--danger-light);
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
#delete-confirm-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.05);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: border-color 0.2s;
}
#delete-confirm-input:focus {
  border-color: rgba(239,68,68,0.6);
}
.notif-mark-all-btn:hover {
  border-color: var(--border-hover);
  color: var(--accent-light);
}

.chrome-bell-btn {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  outline: none;
  flex-shrink: 0;
}
.chrome-bell-btn:hover {
  background: rgba(35, 87, 232, 0.12);
  border-color: rgba(35, 87, 232, 0.35);
  color: var(--accent-light);
  box-shadow: 0 0 14px rgba(35, 87, 232, 0.15);
}
.chrome-bell-btn.has-unread {
  color: var(--accent-light);
  border-color: rgba(35, 87, 232, 0.3);
  background: rgba(35, 87, 232, 0.08);
  animation: bellShake 0.5s var(--ease-spring);
}
@keyframes bellShake {
  0%,100% { transform: rotate(0deg); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}
.chrome-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  background: var(--danger);
  border-radius: 9999px;
  font-size: 8px;
  font-family: var(--font-mono);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-weight: 700;
  border: 1.5px solid var(--panel-solid);
  pointer-events: none;
  line-height: 1;
}
.chrome-bell-badge.visible {
  display: flex;
  animation: scaleIn 0.2s var(--ease-spring);
}
.chrome { display: none !important; }
#chrome-bell-btn.nav-btn.chrome-bell-btn {
  width: auto; height: auto;
  background: none; border: none;
  border-radius: var(--radius-sm);
  flex-direction: column; gap: 2px;
  padding: 6px 12px; min-width: 60px;
}
@media (min-width: 768px) {
  #main-nav #chrome-bell-btn.nav-btn.chrome-bell-btn {
    width: auto;
    min-width: 52px;
    padding: 6px 12px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border: none !important;
    background: none !important;
  }
}
#chrome-bell-btn.nav-btn.chrome-bell-btn .nav-icon {
  position: relative; display: inline-flex;
}
#chrome-bell-btn.nav-btn.chrome-bell-btn .chrome-bell-badge {
  top: -3px; right: -5px;
}
#chrome-bell-btn.nav-btn.chrome-bell-btn:hover {
  box-shadow: none;
  background: rgba(35, 87, 232, 0.07);
}

#notif-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) - 2);
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
#notif-panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}
#notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100dvh;
  background: rgba(18,17,15,1.0);
  border-left: 1px solid var(--border);
  z-index: calc(var(--z-modal) - 1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
  box-shadow: none;
  will-change: transform;
  contain: layout style;
}
#notif-panel.open {
  transform: translateX(0);
  box-shadow: -12px 0 60px rgba(0,0,0,0.6), -1px 0 0 rgba(35, 87, 232, 0.08);
}
#saved-panel-overlay{position:fixed;inset:0;z-index:calc(var(--z-modal) - 2);background:rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:opacity .28s var(--ease)}
#saved-panel-overlay.open{opacity:1;pointer-events:all}
#saved-panel{position:fixed;top:0;right:0;width:min(380px,100vw);height:100dvh;background:rgba(18,17,15,1.0);border-left:1px solid var(--border);z-index:calc(var(--z-modal) - 1);display:flex;flex-direction:column;transform:translateX(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);box-shadow:none;will-change:transform;contain:layout style}
#saved-panel.open{transform:translateX(0);box-shadow:-12px 0 60px rgba(0,0,0,.6),-1px 0 0 rgba(35, 87, 232, .08)}
.saved-panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 13px;border-bottom:1px solid var(--border);flex-shrink:0;background:rgba(15,14,12,.6);position:relative;gap:8px;min-height:60px}
.saved-panel-title-row{display:flex;align-items:center;gap:8px;flex:1}
.saved-panel-title{font-size:14px;font-weight:800;letter-spacing:-.3px;color:var(--text)}
.saved-panel-close{background:rgba(35, 87, 232, .1);border:1px solid rgba(35, 87, 232, .25);border-radius:var(--radius-xs);color:var(--accent-light);cursor:pointer;width:34px;height:34px;min-width:34px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);outline:none;flex-shrink:0}
.saved-panel-close:hover{background:rgba(239,68,68,.18);border-color:rgba(239,68,68,.45);color:var(--danger-light)}
#saved-panel-body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:12px;display:flex;flex-direction:column;gap:10px}
.icon-btn{background:transparent;border:1px solid var(--border);border-radius:var(--radius-xs);color:var(--muted);cursor:pointer;width:34px;height:34px;display:flex;align-items:center;justify-content:center;transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);flex-shrink:0}
.icon-btn:hover{border-color:var(--border-hover);color:var(--accent-light)}
#communities-screen {
  display: none;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}
#communities-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.communities-top {
  padding: 14px 16px 0;
}
.communities-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.communities-top-row h2 {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
  flex: 1;
  margin: 0;
}
.communities-search {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--duration-fast);
}
.communities-search:focus { border-color: var(--border-focus); }
.community-create-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--duration-fast);
  flex-shrink: 0;
}
.community-create-btn:hover { opacity: 0.88; }

.communities-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.communities-filter-row::-webkit-scrollbar { display: none; }

.communities-toggle-row {
  display: flex;
  gap: 8px;
  padding: 4px 0 10px;
}
.comm-toggle-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease);
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  user-select: none;
}
.comm-toggle-btn:hover {
  border-color: rgba(35, 87, 232, 0.45);
  color: var(--text);
  background: rgba(35, 87, 232, 0.06);
  box-shadow: 0 2px 8px rgba(35,87,232,0.12);
  transform: translateY(-1px);
}
.comm-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(35, 87, 232, 0.35);
  transform: translateY(-1px);
}

#communities-list {
  flex: none;
  overflow: visible;
  overscroll-behavior: contain;
  padding: 0 16px calc(var(--screen-pb) + 8px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.community-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.community-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.community-card-body {
  flex: 1;
  min-width: 0;
}
.community-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.community-niche-badge {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(35, 87, 232, 0.12);
  color: var(--accent-light);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  margin: 2px 0 3px;
}
.community-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.community-card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.community-join-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--duration-fast);
}
.community-join-btn:hover { opacity: 0.85; }
.community-join-btn.joined {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--accent-light);
}

.skel-community-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#community-feed-screen {
  display: none;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
#community-feed-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

#comm-header-zone {
  flex-shrink: 0;
  transition: margin-top 240ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 200ms ease;
  will-change: margin-top;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.comm-feed-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.comm-feed-back-btn {
  background: transparent;
  border: none;
  color: var(--accent-light);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.comm-feed-icon { font-size: 22px; flex-shrink: 0; }
.comm-feed-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comm-feed-member-badge {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.comm-feed-join-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--duration-fast);
}
.comm-feed-join-btn:hover { opacity: 0.85; }
.comm-feed-join-btn.joined {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--accent-light);
}
.comm-feed-more-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 16px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comm-feed-more-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 180px;
  z-index: var(--z-dropdown);
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}
.comm-feed-more-dropdown.open { display: flex; }
.comm-feed-dropdown-item {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  padding: 9px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background var(--duration-fast);
}
.comm-feed-dropdown-item:hover { background: rgba(255,255,255,0.05); }
.comm-feed-dropdown-item.danger { color: var(--danger-light); }

.community-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.comm-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 0;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.comm-tab-btn.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.comm-about-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: none;
}
.comm-about-panel.active { display: block; }
.comm-about-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}
.comm-rules-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comm-rules-list li {
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.comm-about-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.comm-posts-controls {
  flex-shrink: 0;
  padding: 8px 16px 0;
}
.comm-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.comm-select-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.comm-select-wrap .comm-select-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  z-index: 1;
}
.comm-dropdown {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.comm-dropdown:focus { border-color: var(--border-focus); }
html[data-theme="dev"] .comm-dropdown { background: rgba(255,255,255,0.05); }
html[data-theme="dev"] .comm-dropdown option { background: #1E2732; color: #e2e8f0; }
.comm-select-arrow {
  position: absolute;
  right: 9px;
  pointer-events: none;
  color: var(--muted);
  display: flex;
  align-items: center;
}
.comm-type-filters {
  display: none;
}
.comm-sort-row {
  display: none;
}

#community-posts-feed {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#community-posts-feed::-webkit-scrollbar { width: 3px; }
#community-posts-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.11); border-radius: 4px; }

.comm-post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: relative;
  transition: border-color var(--duration-fast);
}
.comm-post-card:hover { border-color: rgba(35, 87, 232, 0.22); }
.comm-post-answered-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(5, 150, 105, 0.15);
  color: var(--accent2-light);
  font-size: 10px;
  font-family: var(--font-mono);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.comm-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.comm-post-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.comm-post-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.comm-post-meta { flex: 1; min-width: 0; }
.comm-post-username { font-size: 12px; font-weight: 700; color: var(--text); }
.comm-post-time { font-size: 11px; color: var(--muted); }
.comm-post-type-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-weight: 700;
  flex-shrink: 0;
}
.type-question   { background: rgba(232,192,74,0.15); color: #E8C04A; }
.type-discussion { background: rgba(82,130,255,0.15); color: #82A0FF; }
.type-fun        { background: rgba(5, 150, 105, 0.15); color: var(--accent2-light); }
.type-debate     { background: rgba(35, 87, 232, 0.15); color: var(--accent-light); }
.type-story      { background: rgba(160,82,200,0.15); color: #C882F0; }
.type-announcement { background: rgba(35, 87, 232, 0.18); color: var(--accent-light); }

.comm-post-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 5px; cursor: pointer;
}
.comm-post-body {
  font-size: 13px; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5; cursor: pointer;
}
.comm-post-img {
  width: 100%; max-height: 180px; object-fit: cover;
  border-radius: var(--radius-md); margin-top: 10px; cursor: pointer;
}
.comm-voting-row {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
}
.comm-vote-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 14px;
  width: 30px; height: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.comm-vote-btn.up-active { color: var(--accent2); border-color: var(--accent2); background: rgba(5, 150, 105, 0.08); }
.comm-vote-btn.down-active { color: var(--danger); border-color: var(--danger); background: rgba(224,85,85,0.08); }
.comm-vote-score {
  font-size: 13px; font-weight: 700; color: var(--text);
  min-width: 24px; text-align: center; font-family: var(--font-mono);
}
.comm-post-actions { display: flex; gap: 8px; margin-top: 8px; }
.comm-post-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-display);
  padding: 5px 10px;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  display: flex; align-items: center; gap: 4px;
}
.comm-post-action-btn:hover { border-color: var(--border-hover); color: var(--text); }
.comm-post-action-btn.saved { color: var(--accent-light); border-color: var(--accent); }

.comm-feed-fab {
  position: fixed;
  bottom: 80px; right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-accent);
  z-index: var(--z-dropdown);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.comm-feed-fab:hover { transform: scale(1.08); }
#community-feed-screen.active .comm-feed-fab { display: flex; }

#community-post-screen {
  display: none; flex-direction: column; padding: 0; gap: 0; overflow: hidden;
}
#community-post-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.comm-post-screen-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.comm-post-screen-back {
  background: transparent; border: none;
  color: var(--accent-light); font-size: 20px; cursor: pointer;
}
.comm-post-screen-title {
  font-size: 15px; font-weight: 800; color: var(--text); flex: 1;
}
.comm-post-screen-share {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--muted);
  width: 30px; height: 30px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#comm-post-scroll {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(var(--screen-pb) + 8px);
}
#comm-post-scroll::-webkit-scrollbar { width: 3px; }
#comm-post-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.11); border-radius: 4px; }
.comm-post-full-block { padding: 16px; border-bottom: 1px solid var(--border); }
.comm-post-full-title {
  font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.35; margin: 10px 0 8px;
}
.comm-post-full-body {
  font-size: 14px; color: var(--text-secondary); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.comm-post-full-img {
  width: 100%; border-radius: var(--radius-md); margin-top: 12px; cursor: pointer;
}
.comm-post-full-voting { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.comm-post-full-vote-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--muted); font-size: 18px;
  width: 36px; height: 34px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.comm-post-full-vote-btn.up-active { color: var(--accent2); border-color: var(--accent2); background: rgba(5, 150, 105, 0.08); }
.comm-post-full-vote-btn.down-active { color: var(--danger); border-color: var(--danger); background: rgba(224,85,85,0.08); }
.comm-post-full-score {
  font-size: 18px; font-weight: 800; color: var(--text);
  min-width: 30px; text-align: center; font-family: var(--font-mono);
  transition: color var(--duration-fast);
  will-change: contents;
}
.comm-post-secondary-actions { display: flex; gap: 8px; margin-top: 10px; }
.comm-replies-section { padding: 12px 16px; }
.comm-replies-sort { display: flex; gap: 10px; margin-bottom: 12px; }
.comm-replies-sort-btn {
  background: none; border: none; color: var(--muted); font-size: 11px;
  font-family: var(--font-mono); cursor: pointer; padding: 0 0 3px;
  border-bottom: 2px solid transparent; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.comm-replies-sort-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.comm-reply-card {
  padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px;
  background: var(--surface); position: relative;
}
.comm-reply-card.nested { margin-left: 20px; border-left: 2px solid var(--border); }
.comm-reply-card.best-answer { border-left: 3px solid var(--accent2); background: rgba(5, 150, 105, 0.07); }
.comm-best-answer-banner {
  background: rgba(5, 150, 105, 0.12); color: var(--accent2-light);
  font-size: 11px; font-family: var(--font-mono); font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-xs); margin-bottom: 8px;
}
.comm-reply-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comm-reply-body { font-size: 13px; color: var(--text-secondary); line-height: 1.5; word-break: break-word; }
.comm-reply-img { width: 100%; border-radius: var(--radius-sm); margin-top: 8px; }
.comm-reply-actions-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.comm-reply-vote-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--muted); font-size: 12px;
  padding: 3px 8px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.comm-reply-vote-btn.up-active { color: var(--accent2); border-color: var(--accent2); }
.comm-reply-vote-btn.down-active { color: var(--danger); border-color: var(--danger); }
.comm-reply-vote-score { font-size: 12px; font-family: var(--font-mono); color: var(--text); }
.comm-reply-small-btn {
  background: none; border: none; color: var(--muted);
  font-size: 11px; cursor: pointer; font-family: var(--font-display); padding: 0;
}
.comm-reply-small-btn:hover { color: var(--accent-light); }
.comm-best-answer-mark-btn {
  background: rgba(5, 150, 105, 0.12); border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-xs); color: var(--accent2-light);
  font-size: 11px; padding: 3px 9px; cursor: pointer;
  font-family: var(--font-display); margin-left: auto;
}
.comm-reply-composer {
  position: sticky; bottom: 0;
  background: var(--panel-solid); border-top: 1px solid var(--border);
  padding: 10px 16px 14px;
  display: flex; align-items: flex-end; gap: 8px;
  z-index: var(--z-shell);
}
.comm-reply-composer-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.comm-reply-composer-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.comm-reply-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-family: var(--font-display); font-size: 13px; padding: 8px 12px;
  resize: none; outline: none; min-height: 36px; max-height: 120px;
  overflow-y: auto; transition: border-color var(--duration-fast); line-height: 1.4;
  box-sizing: border-box;
}
.comm-reply-input:focus { border-color: var(--border-focus); }
.comm-reply-send-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-xs); width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; flex-shrink: 0;
  transition: opacity var(--duration-fast);
}
.comm-reply-send-btn:hover { opacity: 0.88; }
.comm-reply-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.comm-best-answer-hint {
  font-size: 11px; color: var(--muted); padding: 6px 16px 0; font-style: italic;
}

.create-mode-tabs {
  display: flex; gap: 8px; padding: 14px 16px 0; flex-shrink: 0;
}
.create-mode-tab {
  flex: 1; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-pill); color: var(--muted);
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  padding: 8px 12px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast); text-align: center;
}
.create-mode-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

#create-community-form {
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.cc-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px; display: block;
}
.cc-community-select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-family: var(--font-display); font-size: 13px; padding: 10px 12px;
  outline: none; cursor: pointer; transition: border-color var(--duration-fast);
}
.cc-community-select:focus { border-color: var(--border-focus); }
.cc-type-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-type-pill {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-pill); color: var(--muted);
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  padding: 6px 12px; cursor: pointer; transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.poll-widget {
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.poll-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
  min-height: 44px;
}
.poll-option-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.poll-option-btn.voted {
  border-color: var(--accent);
  background: rgba(35,87,232,0.07);
  box-shadow: 0 0 0 1.5px var(--accent);
}
.poll-option-btn .poll-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(35,87,232,0.10);
  border-radius: var(--radius-md);
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  z-index: 0;
}
.poll-option-btn .poll-bar-fill.winner {
  background: rgba(35,87,232,0.16);
}
.poll-option-label {
  position: relative; z-index: 1; flex: 1;
}
.poll-option-pct {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: 700;
  color: var(--accent); min-width: 32px; text-align: right;
  opacity: 0;
  transition: opacity 0.3s;
}
.poll-option-pct.visible { opacity: 1; }
.poll-meta {
  font-size: 11px; color: var(--muted);
  text-align: center; margin-top: 4px;
  font-family: var(--font-mono);
}
.comm-post-type-badge.type-poll {
  background: rgba(79,70,229,0.12);
  color: #818cf8;
  border-color: rgba(79,70,229,0.22);
}
.poll-builder {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
}
.poll-builder.visible { display: flex; }
.poll-builder-label {
  font-size: 11px; font-weight: 700;
  color: var(--muted); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.poll-builder-option-row {
  display: flex; gap: 6px; align-items: center;
}
.poll-builder-option-row .input {
  flex: 1; padding: 8px 10px;
  font-size: 13px;
}
.poll-builder-remove-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--danger-light); cursor: pointer;
  padding: 6px 8px; font-size: 12px;
  transition: background 0.15s;
}
.poll-builder-remove-btn:hover {
  background: rgba(239,68,68,0.08);
}
.poll-add-option-btn {
  background: none; border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-md);
  color: var(--accent-light); cursor: pointer;
  font-size: 12px; font-weight: 700;
  font-family: var(--font-display);
  padding: 8px; width: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.poll-add-option-btn:hover {
  background: rgba(35,87,232,0.06);
  border-color: var(--accent);
}

.buildlog-panel {
  padding: 0 0 calc(var(--screen-pb) + 8px);
  overflow-y: auto;
}
.buildlog-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; gap: 10px; color: var(--muted);
  text-align: center;
}
.buildlog-empty-icon {
  width: 56px; height: 56px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  margin-bottom: 6px;
}
.buildlog-empty-title { font-size: 15px; font-weight: 700; color: var(--text); }
.buildlog-empty-sub { font-size: 12px; max-width: 220px; line-height: 1.5; }
.buildlog-add-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; border-radius: var(--radius-pill);
  color: #fff; font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  padding: 10px 20px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-accent);
  transition: box-shadow 0.2s, transform 0.15s;
  margin: 12px 16px;
  width: calc(100% - 32px);
  justify-content: center;
}
.buildlog-add-btn:hover { transform: scale(1.02); box-shadow: var(--shadow-accent-lg); }
.buildlog-timeline {
  display: flex; flex-direction: column;
  padding: 0 16px;
}
.buildlog-entry {
  position: relative;
  padding: 0 0 0 24px;
  padding-bottom: 20px;
}
.buildlog-entry::before {
  content: '';
  position: absolute;
  left: 7px; top: 22px; bottom: 0;
  width: 2px;
  background: var(--border);
}
.buildlog-entry:last-child::before { display: none; }
.buildlog-dot {
  position: absolute; left: 0; top: 14px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 7px;
}
.buildlog-dot.milestone {
  background: linear-gradient(135deg, var(--warning), var(--accent));
  box-shadow: 0 0 10px rgba(35,87,232,0.22);
}
.buildlog-dot.update {
  background: var(--accent);
}
.buildlog-dot.media {
  background: var(--accent2);
}
.buildlog-entry-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.buildlog-entry-card:hover {
  border-color: var(--border-hover);
}
.buildlog-entry-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.buildlog-entry-type-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); letter-spacing: 0.3px;
  text-transform: uppercase; flex-shrink: 0;
}
.buildlog-entry-type-badge.milestone {
  background: rgba(217,119,6,0.12); color: var(--warning);
}
.buildlog-entry-type-badge.update {
  background: rgba(35,87,232,0.10); color: var(--accent-light);
}
.buildlog-entry-type-badge.media {
  background: rgba(5,150,105,0.10); color: var(--accent2-light);
}
.buildlog-entry-ts {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono); margin-left: auto;
}
.buildlog-entry-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.buildlog-entry-desc {
  font-size: 12px; color: var(--text-secondary); line-height: 1.55;
}
.buildlog-entry-img {
  width: 100%; border-radius: var(--radius-xs);
  margin-top: 10px; object-fit: cover; max-height: 200px;
  border: 1px solid var(--border);
}
.buildlog-entry-author {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 11px; color: var(--muted);
}
.buildlog-entry-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; flex-shrink: 0;
}
.buildlog-entry-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.buildlog-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: calc(var(--z-modal) + 10);
}
.buildlog-modal-overlay.open { display: flex; align-items: flex-end; }
.buildlog-modal-sheet {
  background: var(--panel-solid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 36px;
  width: 100%; max-height: 85dvh;
  overflow-y: auto;
}
.buildlog-modal-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 16px;
}
.buildlog-modal-title {
  font-size: 16px; font-weight: 800;
  font-family: var(--font-display);
}
.buildlog-modal-close {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px; font-size: 16px;
}
.buildlog-type-row {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.buildlog-type-card {
  flex: 1; border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: 8px 6px;
  cursor: pointer; text-align: center;
  background: var(--surface);
  transition: border-color 0.18s, background 0.18s;
}
.buildlog-type-card.selected {
  border-color: var(--accent);
  background: rgba(35,87,232,0.07);
}
.buildlog-type-card-icon {
  font-size: 18px; margin-bottom: 4px;
}
.buildlog-type-card-label {
  font-size: 11px; font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.cc-type-pill.active {
  background: rgba(35, 87, 232, 0.15); border-color: var(--accent); color: var(--accent-light);
}
.cc-char-counter {
  font-size: 11px; color: var(--muted); text-align: right;
  font-family: var(--font-mono); margin-top: 3px;
}

#community-create-screen {
  display: none; flex-direction: column; padding: 0; gap: 0; overflow: hidden;
}
#community-create-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }
.comm-create-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.comm-create-back {
  background: transparent; border: none; color: var(--accent-light); font-size: 20px; cursor: pointer;
}
.comm-create-top-title { font-size: 16px; font-weight: 800; color: var(--text); }
#comm-create-body {
  flex: 1; overflow-y: auto; padding: 16px 16px 100px;
  display: flex; flex-direction: column; gap: 18px;
}
#comm-create-body::-webkit-scrollbar { width: 3px; }
#comm-create-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.11); border-radius: 4px; }
.comm-icon-picker {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none;
}
.comm-icon-picker::-webkit-scrollbar { display: none; }
.comm-icon-opt {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-md);
  font-size: 22px; width: 44px; height: 44px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: border-color var(--duration-fast);
}
.comm-icon-opt.selected { border-color: var(--accent); }
.comm-name-status { font-size: 11px; margin-top: 4px; font-family: var(--font-mono); }
.comm-name-status.available { color: var(--success); }
.comm-name-status.taken { color: var(--danger-light); }
.comm-privacy-row { display: flex; gap: 10px; }
.comm-privacy-card {
  flex: 1; background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 12px; cursor: pointer;
  transition: border-color var(--duration-fast); text-align: center;
}
.comm-privacy-card.selected { border-color: var(--accent); }
.comm-privacy-card-icon { font-size: 22px; margin-bottom: 4px; }
.comm-privacy-card-label { font-size: 13px; font-weight: 700; color: var(--text); }
.comm-privacy-card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.comm-rule-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comm-rule-remove {
  background: transparent; border: none; color: var(--danger-light); font-size: 14px; cursor: pointer;
}
.comm-add-rule-btn {
  background: transparent; border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md); color: var(--accent-light);
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  padding: 8px; cursor: pointer; width: 100%; margin-top: 4px;
}
.comm-create-submit-wrap {
  position: sticky; bottom: 0; background: var(--panel-solid);
  border-top: 1px solid var(--border); padding: 14px 16px 20px;
}

#comm-share-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: var(--z-modal);
  align-items: flex-end;
}
#comm-share-modal-overlay.open { display: flex; }
#comm-share-modal {
  width: 100%; background: var(--panel-solid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 16px 36px; max-height: 75dvh; display: flex; flex-direction: column;
}
.comm-share-modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.comm-share-modal-title { font-size: 15px; font-weight: 800; color: var(--text); }
.comm-share-modal-close {
  background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer;
}
#comm-share-search {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-family: var(--font-display);
  font-size: 13px; padding: 9px 12px; outline: none; margin-bottom: 12px; box-sizing: border-box;
}
#comm-share-results { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.comm-share-user-row {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--radius-md); cursor: pointer; transition: background var(--duration-fast);
}
.comm-share-user-row:hover { background: rgba(255,255,255,0.06); }
.comm-share-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.comm-share-user-name { font-size: 13px; font-weight: 700; color: var(--text); }
.comm-share-user-skill { font-size: 11px; color: var(--muted); }

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(248, 249, 252, 0.90);
  position: relative;
  gap: 8px;
  min-height: 60px;
}
.notif-panel-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(35, 87, 232, 0.3), transparent);
}
.notif-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.notif-panel-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: rgba(35, 87, 232, 0.12);
  border: 1px solid rgba(35, 87, 232, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  flex-shrink: 0;
}
.notif-panel-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.notif-panel-count {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.notif-mark-all-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.notif-mark-all-btn:hover {
  border-color: var(--border-hover);
  color: var(--accent-light);
}
.notif-panel-close {
  background: rgba(35, 87, 232, 0.1);
  border: 1px solid rgba(35, 87, 232, 0.25);
  border-radius: var(--radius-xs);
  color: var(--accent-light);
  cursor: pointer;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
  flex-shrink: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.notif-panel-close:hover,
.notif-panel-close:active {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.45);
  color: var(--danger-light);
  transform: scale(1.08);
}
@media (max-width: 360px) {
  .notif-mark-all-btn { display: none; }
  .notif-panel-count { display: none; }
}

@media (max-width: 480px) {
  #notif-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    border-left: none !important;
    box-sizing: border-box;
  }
  #notif-list {
    padding: 10px 10px !important;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
  }
  .notif-item {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    gap: 10px;
    padding: 12px 12px !important;
  }
  .notif-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    flex-shrink: 0;
  }
  .notif-body {
    flex: 1;
    min-width: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }
  .notif-title {
    font-size: 11px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow: visible;
    text-overflow: clip;
    display: block !important;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    word-break: break-word;
  }
  .notif-body-text {
    font-size: 10px !important;
    line-height: 1.35 !important;
    display: block !important;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    word-break: break-word;
  }
  .notif-panel-header {
    padding: 13px 12px 11px !important;
    min-height: 54px !important;
  }
  .notif-panel-title {
    font-size: 13px !important;
  }
  .notif-section-label {
    font-size: 9px !important;
    padding: 8px 2px 4px !important;
  }
}

.notif-swipe-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  background: rgba(35, 87, 232, 0.15);
  border-bottom: 1px solid rgba(35, 87, 232, 0.08);
  font-size: 10px;
  font-family: var(--font-mono);
  color: rgba(35, 87, 232, 0.5);
  letter-spacing: 0.8px;
  flex-shrink: 0;
  animation: fadeIn 0.4s var(--ease) 0.5s both;
}
@media (hover: none) and (pointer: coarse) {
  .notif-swipe-hint { display: flex; }
}

#notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}
#notif-list::-webkit-scrollbar { width: 3px; }
#notif-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.11); border-radius: 3px; }

.notif-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.2s var(--ease) both;
}
.notif-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(35, 87, 232, 0.025));
  pointer-events: none;
}
.notif-item:hover {
  border-color: rgba(35, 87, 232, 0.3);
  background: rgba(35, 87, 232, 0.15);
  transform: translateX(-2px);
}
.notif-item.unread {
  border-color: rgba(35, 87, 232, 0.28);
  background: rgba(35, 87, 232, 0.07);
}
.notif-item.unread::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
}

.notif-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  position: relative;
}
.notif-icon.type-endorse {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.22);
  box-shadow: 0 0 16px rgba(245,158,11,0.08);
}
.notif-icon.type-message {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.2);
  box-shadow: 0 0 16px rgba(5, 150, 105, 0.06);
}
.notif-icon.type-like {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  box-shadow: 0 0 16px rgba(239,68,68,0.06);
}
.notif-icon.type-comment {
  background: rgba(35, 87, 232, 0.1);
  border: 1px solid rgba(35, 87, 232, 0.2);
  box-shadow: 0 0 16px rgba(35, 87, 232, 0.14);
}
.notif-icon.type-system {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  box-shadow: 0 0 16px rgba(16,185,129,0.06);
}
.notif-icon.type-default {
  background: rgba(35, 87, 232, 0.08);
  border: 1px solid rgba(35, 87, 232, 0.15);
}

.notif-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.notif-type-label {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 3px;
  font-weight: 700;
}
.notif-type-label.type-endorse { color: var(--accent3-light); }
.notif-type-label.type-message { color: var(--accent2-light); }
.notif-type-label.type-like { color: #fca5a5; }
.notif-type-label.type-comment { color: var(--accent-light); }
.notif-type-label.type-system { color: var(--success-light); }
.notif-type-label.type-default { color: var(--muted); }

.notif-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-body-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.notif-time::before {
  content: '•';
  font-size: 8px;
  opacity: 0.5;
}

.notif-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 6px rgba(35, 87, 232, 0.5);
  animation: pulseGlow 2s ease-in-out infinite;
}

.notif-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 14px;
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}
.notif-panel-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(35, 87, 232, 0.07);
  border: 1px solid rgba(35, 87, 232, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  animation: floatSlow 4s ease-in-out infinite;
}
.notif-panel-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}
.notif-panel-empty-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 220px;
}

.notif-section-label {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 2px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}

#notif-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
#notif-detail-overlay.open {
  opacity: 1;
  pointer-events: all;
}
#notif-detail-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-modal) + 11);
  background: var(--panel-solid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18), 0 -1px 0 rgba(37,99,235,0.1);
  transform: translateY(105%);
  transition: transform 0.36s cubic-bezier(0.22,1,0.36,1);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
}
html[data-theme="dev"] #notif-detail-sheet {
  background: #1E2732;
  border-top: 1px solid rgba(29, 155, 240, 0.15);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
#notif-detail-sheet.open {
  transform: translateY(0);
}
.notif-detail-drag-bar {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.notif-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-detail-header-title {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.notif-detail-close {
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--radius-xs);
  color: var(--accent-light);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  flex-shrink: 0;
}
.notif-detail-close:hover, .notif-detail-close:active {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: var(--danger-light);
}
.notif-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.notif-detail-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.notif-detail-big-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-detail-big-icon.type-endorse {
  background: rgba(245,158,11,0.14);
  border: 1px solid rgba(245,158,11,0.28);
}
.notif-detail-big-icon.type-message {
  background: rgba(5,150,105,0.12);
  border: 1px solid rgba(5,150,105,0.25);
}
.notif-detail-big-icon.type-like {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
}
.notif-detail-big-icon.type-comment {
  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(37,99,235,0.25);
}
.notif-detail-big-icon.type-system {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
}
.notif-detail-big-icon.type-default {
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.18);
}
.notif-detail-type-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notif-detail-type-badge {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
}
.notif-detail-type-badge.type-endorse { color: var(--accent3-light); }
.notif-detail-type-badge.type-message { color: var(--accent2-light); }
.notif-detail-type-badge.type-like { color: #fca5a5; }
.notif-detail-type-badge.type-comment { color: var(--accent-light); }
.notif-detail-type-badge.type-system { color: var(--success-light); }
.notif-detail-type-badge.type-default { color: var(--muted); }
.notif-detail-ts {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
}
.notif-detail-from {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
html[data-theme="dev"] .notif-detail-from {
  background: rgba(255,255,255,0.05);
}
.notif-detail-from-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-brand);
  flex-shrink: 0;
  overflow: hidden;
}
.notif-detail-from-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.notif-detail-from-info {
  flex: 1;
  min-width: 0;
}
.notif-detail-from-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.notif-detail-from-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-detail-from-handle {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.notif-detail-message-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
html[data-theme="dev"] .notif-detail-message-box {
  background: rgba(255,255,255,0.05);
}
.notif-detail-message-label {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.notif-detail-message-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}
.notif-detail-message-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.notif-detail-action-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  flex-shrink: 0;
}
.notif-detail-action-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}
.notif-detail-action-btn:active {
  transform: translateY(0);
}
.notif-detail-action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  margin-top: -10px;
}
.notif-detail-action-btn.secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.nav-btn { position: relative; }

#notif-toast-banner {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(20,18,16,0.97);
  border: 1px solid rgba(35, 87, 232, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  max-width: 320px;
  width: calc(100% - 40px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: var(--z-toast);
  opacity: 0;
  pointer-events: none;
  transition: color 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
#notif-toast-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.notif-banner-icon { font-size: 18px; flex-shrink: 0; }
.notif-banner-text { flex: 1; line-height: 1.4; }
.notif-banner-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  outline: none;
}
@media (min-width: 768px) {
  #notif-toast-banner {
    left: calc(var(--sidebar-w) + 50%);
    transform: translateX(-50%);
  }
}

#levelup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(248, 249, 252, 0.90); opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#levelup-overlay.show { opacity: 1; pointer-events: all; }
#levelup-card {
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.18), rgba(5, 150, 105, 0.12));
  border: 1px solid rgba(35, 87, 232, 0.45);
  border-radius: 28px; padding: 40px 48px;
  text-align: center; max-width: 340px; width: 90%;
  box-shadow: 0 0 80px rgba(35, 87, 232, 0.3), 0 24px 60px rgba(0,0,0,0.6);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
#levelup-overlay.show #levelup-card { transform: scale(1) translateY(0); }
#levelup-emoji { font-size: 56px; line-height: 1; margin-bottom: 12px; animation: bounceIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
#levelup-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; }
#levelup-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; font-family: var(--font-mono); }
#levelup-close { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-pill); padding: 10px 28px; font-family: var(--font-display); font-weight: 700; font-size: 14px; cursor: pointer; transition: background 0.2s; }
#levelup-close:hover { background: var(--accent-dark); }

#confetti-canvas { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }

.pts-float {
  position: fixed; font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--success-light); pointer-events: none; z-index: 500;
  animation: ptsFloatAnim 1.4s ease forwards;
  text-shadow: 0 0 8px rgba(16,185,129,0.5);
}
@keyframes ptsFloatAnim {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-32px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-56px) scale(0.9); }
}

#streak-badge {
  display: none; align-items: center; gap: 5px;
  font-size: 11px; font-family: var(--font-mono); font-weight: 700;
  color: var(--accent3-light);
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-pill); padding: 3px 10px;
  animation: streakPulse 2.5s ease-in-out infinite;
}
#streak-badge.visible { display: inline-flex; }
@keyframes streakPulse {
  0%,100% { box-shadow: 0 0 0 rgba(245,158,11,0); }
  50% { box-shadow: 0 0 10px rgba(245,158,11,0.25); }
}

.achievement-badges-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.achievement-badge {
  font-size: 10px; font-family: var(--font-mono);
  background: rgba(35, 87, 232, 0.1); border: 1px solid rgba(35, 87, 232, 0.3);
  border-radius: var(--radius-pill); padding: 3px 10px;
  color: var(--accent-light); white-space: nowrap;
}

#leaderboard-panel { display: none; padding: 16px 16px calc(var(--screen-pb) + 16px); flex-direction: column; gap: 10px; overflow: visible; flex: none; }
#leaderboard-panel.active { display: flex; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  transition: border-color 0.2s;
}
.lb-row:hover { border-color: var(--border-hover); }
.lb-rank { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--muted); min-width: 22px; }
.lb-rank.gold { color: #fbbf24; }
.lb-rank.silver { color: #A39890; }
.lb-rank.bronze { color: #b45309; }
.lb-avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.lb-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-skill { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.lb-pts { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent-light); }
.lb-you-chip { font-size: 9px; background: var(--accent); color: #fff; border-radius: var(--radius-pill); padding: 1px 7px; margin-left: 4px; font-family: var(--font-mono); }

.dm-load-earlier-btn {
  display: block; width: calc(100% - 32px); margin: 10px 16px 6px;
  background: rgba(35, 87, 232, 0.08); border: 1px solid rgba(35, 87, 232, 0.2);
  color: var(--accent-light); border-radius: var(--radius-pill);
  font-size: 12px; font-family: var(--font-mono); padding: 8px 16px;
  cursor: pointer; text-align: center; transition: background 0.2s, border-color 0.2s;
}
.dm-load-earlier-btn:hover { background: rgba(35, 87, 232, 0.15); border-color: rgba(35, 87, 232, 0.4); }
.dm-load-earlier-btn:disabled { opacity: 0.5; cursor: default; }

@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.expertise-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.expertise-type-btn {
  background: rgba(35, 87, 232, 0.14);
  border: 1px solid rgba(35, 87, 232, 0.15);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  font-family: var(--font-display);
  font-weight: 600;
  outline: none;
  user-select: none;
}
.expertise-type-btn:hover {
  border-color: rgba(35, 87, 232, 0.35);
  background: rgba(35, 87, 232, 0.12);
  color: var(--text);
}
.expertise-type-btn.active {
  background: rgba(35, 87, 232, 0.2);
  border-color: rgba(35, 87, 232, 0.55);
  color: var(--accent-light);
  box-shadow: 0 0 12px rgba(35, 87, 232, 0.15);
}

.expertise-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px dashed rgba(35, 87, 232, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  background: rgba(35, 87, 232, 0.03);
  font-family: var(--font-display);
  font-weight: 600;
  user-select: none;
}
.expertise-upload-label:hover {
  border-color: rgba(35, 87, 232, 0.5);
  color: var(--accent-light);
  background: rgba(35, 87, 232, 0.08);
}

.expertise-image-preview-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.expertise-img-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-hover);
}
.expertise-img-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}
.expertise-img-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  font-family: var(--font-display);
}

.expertise-code-textarea {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  min-height: 110px;
  resize: vertical;
}

.expertise-audio-preview-wrap {
  margin-top: 8px;
}
.expertise-audio-player {
  width: 100%;
  max-width: 320px;
  height: 36px;
  border-radius: var(--radius-sm);
  outline: none;
}

.expertise-file-preview-wrap {
  margin-top: 8px;
}
.expertise-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(35, 87, 232, 0.10);
  max-width: 100%;
}
.expertise-file-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.expertise-display-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(35, 87, 232, 0.15);
  border-radius: var(--radius-md);
  background: rgba(35, 87, 232, 0.10);
}
.expertise-display-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.expertise-display-label::before {
  content: '';
  width: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}
.expertise-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(5, 150, 105, 0.3);
  background: rgba(5, 150, 105, 0.07);
  font-size: 12px;
  color: var(--accent2-light);
  text-decoration: none;
  word-break: break-all;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.expertise-link-pill:hover {
  background: rgba(5, 150, 105, 0.14);
  border-color: rgba(5, 150, 105, 0.5);
}
.expertise-code-display {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  line-height: 1.6;
}
.expertise-audio-display {
  width: 100%;
  max-width: 280px;
  height: 34px;
  border-radius: var(--radius-sm);
  outline: none;
}
.expertise-images-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.expertise-display-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hover);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease);
}
.expertise-display-img:hover {
  transform: scale(1.04);
}
.expertise-fallback-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.expertise-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-hover);
  background: rgba(35, 87, 232, 0.14);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.edit-expertise-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hover);
  background: var(--glow-accent-soft);
  color: var(--accent-light);
  font-size: 13px;
  font-family: var(--font-display);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
.edit-expertise-btn:hover {
  background: rgba(35, 87, 232, 0.18);
  border-color: var(--accent);
}

#expertise-edit-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 5);
  background: rgba(0,0,0,0.82);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}
#expertise-edit-modal-overlay.open {
  display: flex;
}
#expertise-edit-modal-box {
  background: var(--panel-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 28px 22px 22px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.expertise-fallback-btn:hover {
  background: rgba(35, 87, 232, 0.14);
  color: var(--accent-light);
  border-color: var(--accent);
}

.social-proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.social-proof-connect-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.social-proof-connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.social-proof-connect-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.social-proof-status-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
}
.social-proof-status-pill.connected {
  color: var(--success-light);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}
.social-proof-connect-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.social-proof-mini-btn {
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-pill);
  background: rgba(35, 87, 232, 0.14);
  color: var(--accent-light);
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}
.social-proof-mini-btn:hover { background: rgba(35, 87, 232, 0.14); }
.social-proof-mini-btn:disabled { opacity: 0.6; cursor: default; }
.social-proof-helper {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.social-proof-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}
.social-proof-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(35, 87, 232, 0.12);
}
.social-proof-onboard-data {
  font-size: 11px;
  color: var(--text-secondary);
}
.social-proof-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.social-proof-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
}
.social-proof-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.social-proof-card-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(35, 87, 232, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.social-proof-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.social-proof-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.social-proof-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.social-proof-list a {
  color: var(--accent-light);
  text-decoration: none;
}
.social-proof-list a:hover { text-decoration: underline; }
.social-proof-empty {
  font-size: 11px;
  color: var(--muted);
}

#vault-modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease), visibility 0ms calc(var(--duration-fast) + 10ms);
}
#vault-modal-overlay.active { display: flex; opacity: 1; pointer-events: auto; visibility: visible; transition: opacity var(--duration-fast) var(--ease), visibility 0ms 0ms; }

#vault-decrypt-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease), visibility 0ms calc(var(--duration-fast) + 10ms);
}
#vault-decrypt-overlay.active { display: flex; opacity: 1; pointer-events: auto; visibility: visible; transition: opacity var(--duration-fast) var(--ease), visibility 0ms 0ms; }

#post-edit-modal-overlay.active { opacity: 1 !important; pointer-events: auto !important; visibility: visible !important; transition: opacity 140ms ease, visibility 0ms 0ms !important; }

.vault-modal-box {
  background: var(--panel-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 0;
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(35, 87, 232, 0.1);
  animation: scaleIn var(--duration-normal) var(--ease-spring);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.vault-modal-box::-webkit-scrollbar { width: 4px; }
.vault-modal-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.vault-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel-solid);
  z-index: 2;
}
.vault-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vault-modal-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.2), rgba(5, 150, 105, 0.15));
  border: 1px solid rgba(35, 87, 232, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.vault-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.vault-modal-subtitle {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-top: 1px;
}
.vault-modal-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
  flex-shrink: 0;
}
.vault-modal-close:hover { border-color: var(--border-hover); color: var(--text); }

.vault-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vault-drop-zone {
  border: 2px dashed rgba(35, 87, 232, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: color var(--duration-normal) var(--ease), background var(--duration-normal) var(--ease), border-color var(--duration-normal) var(--ease), box-shadow var(--duration-normal) var(--ease), transform var(--duration-normal) var(--ease), opacity var(--duration-normal) var(--ease);
  position: relative;
  overflow: hidden;
  background: rgba(35, 87, 232, 0.02);
}
.vault-drop-zone:hover {
  border-color: rgba(35, 87, 232, 0.5);
  background: rgba(35, 87, 232, 0.15);
}
.vault-drop-zone.has-file {
  border-color: rgba(5, 150, 105, 0.4);
  background: rgba(5, 150, 105, 0.04);
}
.vault-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.vault-drop-icon {
  font-size: 32px;
  margin-bottom: 8px;
  line-height: 1;
}
.vault-drop-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.vault-drop-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.vault-file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--radius-md);
  animation: fadeIn var(--duration-fast) var(--ease);
}
.vault-file-chip-icon { font-size: 22px; flex-shrink: 0; }
.vault-file-chip-info { flex: 1; min-width: 0; }
.vault-file-chip-name {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.vault-file-chip-size {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.vault-file-chip-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  transition: color var(--duration-fast);
  line-height: 1;
  flex-shrink: 0;
  outline: none;
}
.vault-file-chip-clear:hover { color: var(--danger); }

.vault-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vault-field-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vault-field-label .vault-optional {
  font-size: 9px;
  color: var(--muted);
  opacity: 0.6;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}
.vault-password-wrap {
  position: relative;
}
.vault-password-wrap .input {
  padding-right: 44px;
}
.vault-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--duration-fast);
  font-size: 14px;
  line-height: 1;
  outline: none;
}
.vault-pw-toggle:hover { color: var(--text); }

.vault-question-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn var(--duration-fast) var(--ease);
}
.vault-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vault-question-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.5px;
}
.vault-question-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  transition: color var(--duration-fast);
  line-height: 1;
  outline: none;
}
.vault-question-remove:hover { color: var(--danger); }
.vault-add-question-btn {
  background: rgba(35, 87, 232, 0.14);
  border: 1px dashed rgba(35, 87, 232, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  outline: none;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}
.vault-add-question-btn:hover {
  background: rgba(35, 87, 232, 0.12);
  border-color: rgba(35, 87, 232, 0.45);
}

.vault-security-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(35, 87, 232, 0.10);
  border: 1px solid rgba(35, 87, 232, 0.15);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.vault-security-notice .vault-notice-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.vault-send-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: var(--shadow-accent);
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
.vault-send-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent-lg); }
.vault-send-btn:active { transform: translateY(0); }
.vault-send-btn:disabled { opacity: 0.4; pointer-events: none; transform: none; }

.msg-vault-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(35, 87, 232, 0.3);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.08), rgba(5, 150, 105, 0.05));
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  min-width: 220px;
  max-width: 280px;
  position: relative;
  overflow: hidden;
}
.msg-vault-bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.10), transparent);
  pointer-events: none;
}
.msg-vault-bubble:hover {
  border-color: rgba(35, 87, 232, 0.55);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.14), rgba(5, 150, 105, 0.08));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(35, 87, 232, 0.2);
}
.msg-vault-bubble.decrypted {
  border-color: rgba(5, 150, 105, 0.4);
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(5, 150, 105, 0.04));
  cursor: default;
  transform: none;
  box-shadow: none;
}
.msg-vault-bubble.decrypted:hover { border-color: rgba(5, 150, 105, 0.4); }
.vault-bubble-lock {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.25), rgba(35, 87, 232, 0.15));
  border: 1px solid rgba(35, 87, 232, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: color var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
}
.msg-vault-bubble:hover .vault-bubble-lock {
  background: linear-gradient(135deg, rgba(35, 87, 232, 0.35), rgba(35, 87, 232, 0.25));
}
.msg-vault-bubble.decrypted .vault-bubble-lock {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(5, 150, 105, 0.12));
  border-color: rgba(5, 150, 105, 0.35);
}
.vault-bubble-info { flex: 1; min-width: 0; }
.vault-bubble-filename {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.vault-bubble-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent-light);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.vault-bubble-label.unlocked { color: var(--accent2-light); }

.vault-bubble-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(35, 87, 232, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

html[data-theme="dev"] .vault-modal-icon {
  background: linear-gradient(135deg, rgba(29, 155, 240, 0.15), rgba(57,211,83,0.1));
  border-color: rgba(29, 155, 240, 0.3);
}
html[data-theme="dev"] .vault-drop-zone { border-color: rgba(29, 155, 240, 0.18); }
html[data-theme="dev"] .vault-drop-zone:hover { border-color: rgba(29, 155, 240, 0.45); background: rgba(29, 155, 240, 0.04); }
html[data-theme="dev"] .vault-add-question-btn { border-color: rgba(29, 155, 240, 0.18); color: #60BBEF; }
html[data-theme="dev"] .vault-add-question-btn:hover { background: rgba(29, 155, 240, 0.1); border-color: rgba(29, 155, 240, 0.45); }
html[data-theme="dev"] .msg-vault-bubble { border-color: rgba(29, 155, 240, 0.25); }
html[data-theme="dev"] .msg-vault-bubble:hover { border-color: rgba(29, 155, 240, 0.5); }
html[data-theme="dev"] .vault-bubble-lock { background: rgba(29, 155, 240, 0.12); border-color: rgba(29, 155, 240, 0.25); }
html[data-theme="dev"] .vault-bubble-label { color: #60BBEF; }
html[data-theme="dev"] .vault-send-btn {
  background: linear-gradient(135deg, #1D9BF0, #1A8CD8);
  color: #FFFFFF;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.30); border-radius: 4px; }
html[data-theme="dev"] ::-webkit-scrollbar-thumb { background: rgba(29, 155, 240, 0.15); }

html[data-theme="dev"] #main-nav {
  background: rgba(21, 32, 43, 0.99) !important;
  border-top-color: #253341 !important;
}
html[data-theme="dev"] .nav-btn:hover {
  background: rgba(29, 155, 240, 0.08);
  color: var(--text);
}

#notif-panel {
  background: var(--panel-solid);
}
html[data-theme="dev"] #notif-panel {
  background: rgba(21, 32, 43, 0.99);
}
.notif-panel-header {
  background: var(--surface) !important;
}
html[data-theme="dev"] .notif-panel-header {
  background: rgba(21, 32, 43, 0.96) !important;
}

.notif-item {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .notif-item {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.06) !important;
}
.notif-item.unread {
  background: rgba(37,99,235,0.06) !important;
  border-color: rgba(37,99,235,0.22) !important;
}
html[data-theme="dev"] .notif-item.unread {
  background: rgba(29, 155, 240, 0.07) !important;
  border-color: rgba(29,155,240,0.20) !important;
}
.notif-item:hover {
  background: rgba(37,99,235,0.05) !important;
  border-color: rgba(37,99,235,0.22) !important;
}
html[data-theme="dev"] .notif-item:hover {
  background: rgba(29, 155, 240, 0.05) !important;
}
.notif-section-label {
  border-bottom: 1px solid var(--border) !important;
}
#notif-list { scrollbar-color: rgba(148,163,184,0.30) transparent; }
html[data-theme="dev"] #notif-list { scrollbar-color: rgba(29,155,240,0.15) transparent; }

#saved-panel {
  background: var(--panel-solid) !important;
}
html[data-theme="dev"] #saved-panel {
  background: rgba(21, 32, 43, 0.99) !important;
}
.saved-panel-header {
  background: var(--surface) !important;
}
html[data-theme="dev"] .saved-panel-header {
  background: rgba(21, 32, 43, 0.96) !important;
}

.user-profile-sheet-inner {
  background: var(--panel-solid) !important;
  color: var(--text);
  box-shadow: none !important;
}
html[data-theme="dev"] .user-profile-sheet-inner {
  background: linear-gradient(160deg, #1E2B3A 0%, #15202B 100%) !important;
  box-shadow: none !important;
}
.ups-drag-handle {
  background: var(--muted-light) !important;
}
html[data-theme="dev"] .ups-drag-handle {
  background: rgba(255,255,255,0.16) !important;
}
.ups-avatar-inner {
  border-color: var(--panel-solid) !important;
  background: var(--surface) !important;
}
html[data-theme="dev"] .ups-avatar-inner {
  border-color: #15202B !important;
  background: var(--panel-solid) !important;
}
.ups-story-badge {
  border-color: var(--panel-solid) !important;
}
html[data-theme="dev"] .ups-story-badge {
  border-color: #15202B !important;
}
.ups-stat-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .ups-stat-card {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.06) !important;
}
.ups-divider {
  background: var(--border) !important;
}
html[data-theme="dev"] .ups-divider {
  background: rgba(255,255,255,0.05) !important;
}
.ups-qa-btn {
  border-color: var(--border) !important;
  background: var(--surface) !important;
  color: var(--text-secondary) !important;
}
.ups-qa-btn:hover {
  background: rgba(37,99,235,0.04) !important;
  border-color: var(--border-hover) !important;
  color: var(--text) !important;
}
html[data-theme="dev"] .ups-qa-btn {
  border-color: rgba(255,255,255,0.11) !important;
  background: rgba(255,255,255,0.05) !important;
  color: var(--text-secondary) !important;
}
html[data-theme="dev"] .ups-qa-btn:hover {
  background: rgba(255,255,255,0.11) !important;
  border-color: rgba(255,255,255,0.16) !important;
  color: var(--text) !important;
}
.ups-qa-btn.danger {
  color: rgba(239,68,68,0.7) !important;
  border-color: rgba(239,68,68,0.15) !important;
  background: rgba(239,68,68,0.04) !important;
}
.ups-qa-btn.danger:hover {
  background: rgba(239,68,68,0.1) !important;
  border-color: rgba(239,68,68,0.35) !important;
  color: var(--danger-light) !important;
}
.ups-post-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .ups-post-card {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

.ups-tab-btn {
  color: var(--muted) !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
}
.ups-tab-btn.active {
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

.confirm-modal-box {
  background: var(--panel-solid) !important;
}
html[data-theme="dev"] .confirm-modal-box {
  background: rgba(21, 32, 43, 0.99) !important;
}
.confirm-modal-cancel {
  background: var(--surface) !important;
  color: var(--text-secondary) !important;
}
html[data-theme="dev"] .confirm-modal-cancel {
  background: rgba(255,255,255,0.06) !important;
}

.report-modal-box {
  background: var(--panel-solid) !important;
}
html[data-theme="dev"] .report-modal-box {
  background: rgba(21, 32, 43, 0.99) !important;
}
.report-reason-btn {
  background: var(--surface) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .report-reason-btn {
  background: rgba(255,255,255,0.06) !important;
}

.feedback-modal-box {
  background: var(--panel-solid) !important;
}
html[data-theme="dev"] .feedback-modal-box {
  background: rgba(21, 32, 43, 0.99) !important;
}
.feedback-modal-cancel-btn {
  background: var(--surface) !important;
  color: var(--text-secondary) !important;
}
html[data-theme="dev"] .feedback-modal-cancel-btn {
  background: rgba(255,255,255,0.06) !important;
}

#notif-toast-banner {
  background: var(--panel-solid) !important;
  border-color: rgba(37,99,235,0.30) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
}
html[data-theme="dev"] #notif-toast-banner {
  background: rgba(21, 32, 43, 0.97) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5) !important;
}

#user-info-panel {
  background: var(--panel-solid) !important;
}
html[data-theme="dev"] #user-info-panel {
  background: rgba(21, 32, 43, 0.97) !important;
}
.info-panel-header {
  background: var(--surface) !important;
}
html[data-theme="dev"] .info-panel-header {
  background: rgba(21, 32, 43, 0.95) !important;
}
.info-stat-row {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .info-stat-row {
  background: rgba(255,255,255,0.06) !important;
}
.info-panel-close {
  background: var(--surface) !important;
}
html[data-theme="dev"] .info-panel-close {
  background: rgba(255,255,255,0.06) !important;
}

.post-card {
  background: var(--surface) !important;
}

.create-audio-zone {
  background: var(--surface) !important;
}
.create-link-preview {
  background: var(--surface) !important;
}

.guild-msg-text {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html[data-theme="dev"] .guild-msg-text {
  background: rgba(255,255,255,0.16) !important;
  border-color: rgba(255,255,255,0.11) !important;
}
.guild-msg.mine .guild-msg-text {
  background: linear-gradient(145deg, var(--accent), #9A6428) !important;
  border: none !important;
  color: #fff !important;
}

.guild-msg-skill-tag {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .guild-msg-skill-tag {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.11) !important;
}

.guild-msg-deleted {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .guild-msg-deleted {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

.guild-reaction-picker {
  background: var(--panel-solid) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}
html[data-theme="dev"] .guild-reaction-picker {
  background: rgba(21, 32, 43, 0.98) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

.guild-msg-actions {
  background: var(--panel-solid) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-md) !important;
}
html[data-theme="dev"] .guild-msg-actions {
  background: rgba(21, 32, 43, 0.97) !important;
  border-color: rgba(255,255,255,0.11) !important;
}

.guild-input-area {
  border-top-color: var(--border) !important;
  background: var(--surface) !important;
}
html[data-theme="dev"] .guild-input-area {
  background: rgba(21, 32, 43, 0.96) !important;
  border-top-color: #253341 !important;
}

.guild-input-area .input {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html[data-theme="dev"] .guild-input-area .input {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

.skill-card {
  background: var(--surface) !important;
}
html[data-theme="dev"] .skill-card {
  background: rgba(255,255,255,0.06) !important;
}
.level-card {
  background: var(--surface) !important;
}
html[data-theme="dev"] .level-card {
  background: rgba(255,255,255,0.06) !important;
}
.goal-pill, .avail-pill {
  background: var(--surface) !important;
}
html[data-theme="dev"] .goal-pill, html[data-theme="dev"] .avail-pill {
  background: rgba(255,255,255,0.05) !important;
}
.goal-pill:hover, .avail-pill:hover {
  border-color: var(--border-hover) !important;
}
html[data-theme="dev"] .goal-pill:hover, html[data-theme="dev"] .avail-pill:hover {
  border-color: rgba(255,255,255,0.15) !important;
}

.toggle-pill {
  background: var(--surface) !important;
}
html[data-theme="dev"] .toggle-pill {
  background: rgba(255,255,255,0.06) !important;
}

html[data-theme="dev"] .dir-search-combo {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.16);
}
html[data-theme="dev"] .dir-combo-select {
  color-scheme: dark;
}
html[data-theme="dev"] .dir-online-btn:hover {
  background: rgba(16,185,129,0.12);
}
html[data-theme="dev"] .dir-online-btn.active {
  background: rgba(16,185,129,0.14);
}
html[data-theme="dev"] .dir-combo-sep {
  background: rgba(255,255,255,0.16);
}

.user-item {
  background: var(--surface) !important;
}
html[data-theme="dev"] .user-item {
  background: rgba(255,255,255,0.02) !important;
}

.lb-row {
  background: var(--surface) !important;
}
html[data-theme="dev"] .lb-row {
  background: rgba(255,255,255,0.06) !important;
}

html[data-theme="dev"] #levelup-overlay {
  background: rgba(21, 32, 43, 0.92);
}

.chrome-bell-btn {
  background: rgba(15,23,42,0.04) !important;
  border-color: rgba(15,23,42,0.08) !important;
}
html[data-theme="dev"] .chrome-bell-btn {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

.back-btn {
  background: var(--surface) !important;
}
html[data-theme="dev"] .back-btn {
  background: rgba(255,255,255,0.06) !important;
}

#chat-search-bar {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] #chat-search-bar {
  background: rgba(21, 32, 43, 0.88) !important;
}

.vault-question-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .vault-question-card {
  background: rgba(255,255,255,0.06) !important;
}

@media (min-width: 768px) {
  html:not([data-theme="dev"]) .user-profile-sheet-inner {
    border-color: rgba(37,99,235,0.15) !important;
  }
}

.endorse-count-row {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .endorse-count-row {
  background: rgba(255,255,255,0.02) !important;
}

html:not([data-theme="dev"]) #profile-modal {
  background: rgba(248, 249, 252, 0.98) !important;
  color: var(--text) !important;
}

.create-share-type-btn {
  background: var(--surface) !important;
}
html[data-theme="dev"] .create-share-type-btn {
  background: rgba(255,255,255,0.05) !important;
}
.content-type-btn {
  background: var(--surface) !important;
}
html[data-theme="dev"] .content-type-btn {
  background: rgba(255,255,255,0.06) !important;
}

html:not([data-theme="dev"]) .desktop-sidebar {
  background: rgba(248, 249, 252, 0.99);
}
html[data-theme="dev"] .desktop-sidebar {
  background: rgba(21, 32, 43, 0.99);
}

#img-preview-bar {
  background: var(--surface) !important;
  border-top-color: var(--border) !important;
}
html[data-theme="dev"] #img-preview-bar {
  background: rgba(21, 32, 43, 0.96) !important;
}

.chat-input-area {
  background: var(--surface) !important;
  border-top-color: var(--border) !important;
}
html[data-theme="dev"] .chat-input-area {
  background: rgba(21, 32, 43, 0.96) !important;
  border-top-color: #253341 !important;
}

.msg-file-bubble {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .msg-file-bubble {
  background: rgba(255,255,255,0.06) !important;
}

.reaction-chip {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .reaction-chip {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

.guild-reaction-chip {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
html[data-theme="dev"] .guild-reaction-chip {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.11) !important;
}

html:not([data-theme="dev"]) .skel-animate {
  background: linear-gradient(90deg, rgba(15,23,42,0.06) 25%, rgba(15,23,42,0.10) 50%, rgba(15,23,42,0.06) 75%);
  background-size: 400% 100%;
}

html:not([data-theme="dev"]) .room-submit-wrap {
  background: linear-gradient(to top, rgba(248,249,252,0.98) 70%, transparent);
}

html:not([data-theme="dev"]) #vault-modal,
html:not([data-theme="dev"]) #vault-decrypt-modal {
  background: var(--panel-solid) !important;
  color: var(--text);
}

html[data-theme="dev"] #stories-bar-wrap {
  background: rgba(21, 32, 43, 0.92) !important;
  border-bottom-color: rgba(148, 163, 200, 0.07) !important;
}

html[data-theme="dev"] #explore-screen,
html[data-theme="dev"] #communities-screen,
html[data-theme="dev"] #rooms-screen,
html[data-theme="dev"] #projects-screen {
  scrollbar-color: rgba(29, 155, 240, 0.15) transparent;
}
html[data-theme="dev"] #explore-screen::-webkit-scrollbar,
html[data-theme="dev"] #communities-screen::-webkit-scrollbar,
html[data-theme="dev"] #rooms-screen::-webkit-scrollbar,
html[data-theme="dev"] #projects-screen::-webkit-scrollbar { width: 4px; }
html[data-theme="dev"] #explore-screen::-webkit-scrollbar-thumb,
html[data-theme="dev"] #communities-screen::-webkit-scrollbar-thumb,
html[data-theme="dev"] #rooms-screen::-webkit-scrollbar-thumb,
html[data-theme="dev"] #projects-screen::-webkit-scrollbar-thumb {
  background: rgba(29, 155, 240, 0.15);
  border-radius: 2px;
}
html:not([data-theme="dev"]) #explore-screen::-webkit-scrollbar,
html:not([data-theme="dev"]) #communities-screen::-webkit-scrollbar,
html:not([data-theme="dev"]) #rooms-screen::-webkit-scrollbar,
html:not([data-theme="dev"]) #projects-screen::-webkit-scrollbar { width: 4px; }
html:not([data-theme="dev"]) #explore-screen::-webkit-scrollbar-thumb,
html:not([data-theme="dev"]) #communities-screen::-webkit-scrollbar-thumb,
html:not([data-theme="dev"]) #rooms-screen::-webkit-scrollbar-thumb,
html:not([data-theme="dev"]) #projects-screen::-webkit-scrollbar-thumb {
  background: rgba(35, 87, 232, 0.18);
  border-radius: 2px;
}

html[data-theme="dev"] .guild-header {
  background: rgba(21, 32, 43, 0.92) !important;
  border-bottom-color: rgba(148, 163, 200, 0.07) !important;
}

html[data-theme="dev"] .explore-top {
  background: rgba(21, 32, 43, 0.92) !important;
  border-bottom-color: rgba(148, 163, 200, 0.07) !important;
}

html[data-theme="dev"] #chat-search-bar {
  background: rgba(21, 32, 43, 0.92) !important;
  border-bottom-color: rgba(148, 163, 200, 0.07) !important;
}

html[data-theme="dev"] .notif-panel-header::after {
  background: rgba(21, 32, 43, 0.92) !important;
}

#toast {
  color: rgba(255, 255, 255, 0.92) !important;
}
#toast.error {
  color: var(--danger-light) !important;
}
#toast.success {
  color: var(--success-light) !important;
}
html:not([data-theme="dev"]) #toast {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(35, 87, 232, 0.30) !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(35, 87, 232, 0.12) !important;
}

#video-switch-popup {
  background: var(--panel-solid) !important;
  border-color: rgba(35, 87, 232, 0.3) !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(35, 87, 232, 0.08) !important;
}
html[data-theme="dev"] #video-switch-popup {
  background: rgba(20, 18, 16, 0.97) !important;
  border-color: rgba(35, 87, 232, 0.4) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(35, 87, 232, 0.1) !important;
}

@media (max-width: 599px) {

  .create-mode-tabs {
    padding: 10px 12px 0;
    gap: 6px;
  }
  .create-mode-tab {
    font-size: 11px;
    padding: 7px 10px;
  }

  .create-header {
    padding: 12px 14px 0;
  }
  .create-header h2 {
    font-size: 18px;
  }
  .create-microcopy {
    font-size: 11px;
    margin-bottom: 10px;
  }

  .create-body {
    padding: 0 14px 68px;
    gap: 12px;
  }

  #create-community-form {
    padding: 12px;
    gap: 12px;
  }

  .create-share-type-row {
    margin-bottom: 12px;
  }
  .create-share-type-btn {
    padding: 8px 8px;
    font-size: 11px;
  }

  .create-section-label {
    margin-bottom: 5px;
  }

  #create-textarea {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 90px;
  }

  .room-create-body {
    padding: 16px 13px 88px;
  }
  .room-form-section {
    margin-bottom: 16px;
  }

  .room-type-card {
    padding: 12px 10px;
  }
  .room-type-card-icon {
    font-size: 18px;
    margin-bottom: 4px;
  }
  .room-type-card-name {
    font-size: 12px;
  }
  .room-type-card-desc {
    font-size: 10px;
  }

  .comm-create-body {
    padding: 12px 14px calc(var(--screen-pb) + 8px);
  }

  #leaderboard-panel {
    padding-bottom: 68px;
  }

  .post-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
    border-radius: var(--radius-sm);
  }

  .chat-input-area {
    padding: 7px 10px 11px;
    gap: 5px;
  }
  .chat-input-area .input {
    font-size: 14px;
    padding: 8px 12px;
  }

  .room-input-area {
    padding: 7px 10px 11px;
    gap: 5px;
  }

  .back-btn {
    padding: 7px 10px;
    font-size: 14px;
  }

  .recs-scroll {
    padding-bottom: 2px;
    gap: 6px;
  }
  .rec-card {
    min-width: 100px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }
  .rec-name {
    font-size: 11px;
  }
  .rec-skill {
    font-size: 9px;
  }

  #profile-completion-banner {
    padding: 8px 12px;
    font-size: 11px;
    margin-bottom: 9px;
    border-radius: var(--radius-sm);
  }

  .guild-reaction-picker {
    bottom: calc(100% + 4px);
  }

  .section-sep {
    margin: 8px 0 6px;
  }

  .profile-body {
    padding: 14px 14px;
  }
}

@media (max-width: 399px) {
  .create-mode-tabs {
    padding: 8px 10px 0;
  }
  .create-mode-tab {
    font-size: 10px;
    padding: 6px 8px;
  }
  .create-header {
    padding: 10px 12px 0;
  }
  .create-body {
    padding: 0 12px 68px;
  }
  #create-community-form {
    padding: 10px;
  }
  .post-avatar {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
  .nav-btn {
    min-width: 44px;
    padding: 6px 7px;
  }
  .nav-btn .nav-icon svg {
    width: 18px !important;
    height: 18px !important;
  }
}

#projects-screen {
  padding: 0;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}
#projects-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.projects-top {
  padding: 18px 18px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.projects-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.projects-top-title {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
}
.projects-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.projects-create-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent-lg); }

.projects-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.projects-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.projects-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(35, 87, 232, 0.03);
}
.projects-tab:hover:not(.active) { color: var(--text); background: rgba(37,99,235,0.03); }

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

.projects-list-wrap {
  flex: none;
  overflow: visible;
  padding: 12px 12px calc(var(--screen-pb) + 8px);
}

.proj-work-search-wrap {
  margin-bottom: 10px;
}

.projects-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 4px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.projects-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  border-radius: 1px;
}

.project-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--accent3));
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.project-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-card:hover::before { opacity: 1; }

.project-card-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(79,70,229,0.14));
  border: 1px solid rgba(37,99,235,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.project-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.project-card-body { flex: 1; min-width: 0; }
.project-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.project-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  margin-bottom: 8px;
}
.project-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.project-card-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.project-role-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.project-role-pill {
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-light);
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.project-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
  margin-left: 4px;
}
.project-join-btn {
  padding: 6px 13px;
  background: rgba(37,99,235,0.10);
  border: 1px solid rgba(37,99,235,0.28);
  color: var(--accent-light);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.project-join-btn:hover { background: rgba(37,99,235,0.18); transform: translateY(-1px); }
.project-join-btn.member {
  background: rgba(5,150,105,0.08);
  border-color: rgba(5,150,105,0.28);
  color: var(--success-light);
}
.project-join-btn.request {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.28);
  color: var(--warning-light);
}
.project-join-btn.pending {
  background: rgba(79,70,229,0.09);
  border-color: rgba(79,70,229,0.24);
  color: var(--accent3-light);
}
.project-join-btn.declined {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.24);
  color: var(--danger-light);
}
.project-visibility-badge {
  font-size: 9px;
  font-family: var(--font-mono);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.project-visibility-badge.public {
  background: rgba(5,150,105,0.08);
  border: 1px solid rgba(5,150,105,0.2);
  color: var(--success-light);
}
.project-visibility-badge.private {
  background: rgba(79,70,229,0.08);
  border: 1px solid rgba(79,70,229,0.2);
  color: var(--accent3-light);
}

.work-ad-card .project-card-name {
  margin-bottom: 4px;
}
.work-ad-owner {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.work-ad-owner-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.work-ad-owner-btn:hover { text-decoration: underline; }
.work-ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.work-ad-review-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--accent3-light);
  background: rgba(79,70,229,0.08);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}

.projects-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.projects-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.projects-empty-title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.projects-empty-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.skel-project-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  animation: skeletonFadeIn 0.4s var(--ease) both;
}
.skel-project-card:nth-child(2) { animation-delay: 0.08s; }
.skel-project-card:nth-child(3) { animation-delay: 0.16s; }

#project-create-screen {
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
#project-create-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.proj-create-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.proj-create-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.proj-create-back:hover { border-color: var(--border-hover); color: var(--text); }
.proj-create-topbar-title {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
}

.proj-create-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.proj-create-body::-webkit-scrollbar { width: 4px; }
.proj-create-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.proj-form-section {
  margin-bottom: 18px;
}
.proj-form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.proj-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.proj-type-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  text-align: center;
}
.proj-type-card:hover { border-color: var(--border-hover); }
.proj-type-card.selected {
  border-color: var(--accent);
  background: rgba(37,99,235,0.06);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.14);
}
.proj-type-card-icon { font-size: 22px; margin-bottom: 6px; }
.proj-type-card-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.proj-type-card-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }

.proj-roles-list { display: flex; flex-direction: column; gap: 8px; }
.proj-role-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: skeletonFadeIn 0.3s var(--ease) both;
}
.proj-role-row select,
.proj-role-row input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 12px;
  padding: 6px 8px;
  font-family: var(--font-display);
  outline: none;
  transition: border-color var(--duration-fast);
}
.proj-role-row select:focus,
.proj-role-row input[type="number"]:focus { border-color: var(--accent); }
.proj-role-row select { flex: 1; min-width: 0; cursor: pointer; }
.proj-role-row input[type="number"] { width: 60px; flex-shrink: 0; }
.proj-role-remove-btn {
  background: none;
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--danger-light);
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.proj-role-remove-btn:hover { background: rgba(239,68,68,0.10); }
.proj-add-role-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(37,99,235,0.06);
  border: 1px dashed rgba(37,99,235,0.28);
  color: var(--accent-light);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}
.proj-add-role-btn:hover { background: rgba(37,99,235,0.12); }

.proj-cover-preview {
  width: 100%;
  height: 90px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(79,70,229,0.06));
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  position: relative;
}
.proj-cover-preview:hover { border-color: var(--accent); }
.proj-cover-preview img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.proj-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-display);
  pointer-events: none;
}
.proj-cover-placeholder-icon { font-size: 22px; opacity: 0.6; }

.proj-seek-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.18);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.proj-seek-row:hover { background: rgba(245,158,11,0.08); }
.proj-seek-row input[type="checkbox"] { accent-color: var(--warning); flex-shrink: 0; }
.proj-seek-label {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}
.proj-seek-label b { color: var(--warning-light); }

.proj-submit-wrap {
  padding: 12px 16px 16px;
  background: linear-gradient(to top, var(--surface) 70%, transparent);
  flex-shrink: 0;
}

#project-workspace-screen {
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
#project-workspace-screen.active { display: flex; animation: glx-screenIn 90ms var(--ease-out) both; }

.proj-ws-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.proj-ws-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.proj-ws-back:hover { border-color: var(--border-hover); color: var(--text); }
.proj-ws-cover-mini {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(79,70,229,0.15));
  border: 1px solid rgba(37,99,235,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.proj-ws-cover-mini img { width: 100%; height: 100%; object-fit: cover; }
.proj-ws-info { flex: 1; min-width: 0; }
.proj-ws-name {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-ws-sub {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-ws-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.proj-ws-avatar-stack {
  display: flex;
  flex-direction: row-reverse;
}
.proj-ws-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(79,70,229,0.15));
  border: 2px solid var(--surface);
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  margin-left: -6px;
  overflow: hidden;
}
.proj-ws-avatar:first-child { margin-left: 0; }
.proj-ws-avatar img { width: 100%; height: 100%; object-fit: cover; }
.proj-ws-more-count {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--surface);
  font-size: 8px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  margin-left: -6px;
  flex-shrink: 0;
}
.proj-ws-menu-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.proj-ws-menu-btn:hover { border-color: var(--border-hover); color: var(--text); }
.proj-ws-call-btn {
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.28);
  color: var(--accent-light);
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  flex-shrink: 0;
  gap: 5px;
}
.proj-ws-call-btn:hover { border-color: rgba(37,99,235,0.5); background: rgba(37,99,235,0.14); }
.proj-ws-call-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.proj-ws-tab-bar {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.proj-ws-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
}
.proj-ws-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.proj-ws-tab:hover:not(.active) { color: var(--text); background: rgba(37,99,235,0.03); }

.proj-ws-panel { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.proj-ws-panel.active { display: flex; }
.proj-call-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin: 10px 10px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(37,99,235,0.04);
}
.proj-call-bar-status {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
#proj-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 17, 38, 0.72);
}
#proj-call-overlay.active { display: flex; }
.proj-call-card {
  width: min(420px, calc(100% - 28px));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 14px;
}
.proj-call-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-display);
}
.proj-call-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.proj-call-member-list {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 180px;
  overflow-y: auto;
}
.proj-call-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--text);
}
.proj-call-member-row + .proj-call-member-row { border-top: 1px solid var(--border); }
.proj-call-member-muted {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.proj-call-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.proj-call-action {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.proj-call-action.leave {
  background: rgba(224,85,85,0.12);
  border-color: rgba(224,85,85,0.3);
  color: var(--danger-light);
}
.proj-call-action.video-switch {
  background: rgba(79,70,229,0.10);
  border-color: rgba(79,70,229,0.32);
  color: #818cf8;
  font-size: 11px;
}
.proj-call-action.video-switch:hover { background: rgba(79,70,229,0.18); }
.proj-call-action.video-switch:disabled { opacity: 0.45; cursor: not-allowed; }

#proj-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: #07080f;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#proj-video-overlay.active { display: flex; }

.pvg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.55);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 10px;
}
.pvg-top-title {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-display);
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  gap: 7px;
}
.pvg-top-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34,211,238,0.7);
  animation: pvgPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pvgPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.85)} }
.pvg-top-count {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.pvg-top-status {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
  margin-left: auto;
  flex-shrink: 0;
}

.pvg-grid {
  flex: 1;
  display: grid;
  gap: 3px;
  padding: 3px;
  overflow: hidden;
}
.pvg-grid.count-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.pvg-grid.count-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.pvg-grid.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pvg-grid.count-3 .pvt-tile:nth-child(3) { grid-column: 1 / -1; }
.pvg-grid.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.pvt-tile {
  position: relative;
  background: #0d1018;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.25s;
}
.pvt-tile.speaking { border-color: #22d3ee; }
.pvt-tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
  transform: scaleX(-1); /* mirror self-view */
}
.pvt-tile.has-video video { display: block; }
.pvt-tile.is-remote video { transform: none; } /* don't mirror remote */

.pvt-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pvt-tile.has-video .pvt-avatar-wrap { display: none; }
.pvt-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(29,155,240,0.22), rgba(99,102,241,0.18));
  border: 2px solid rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.pvt-voice-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.pvt-voice-wave .bar {
  width: 3px;
  background: rgba(34,211,238,0.5);
  border-radius: 2px;
  animation: pvgWave 0.9s ease-in-out infinite;
}
.pvt-voice-wave .bar:nth-child(1) { height: 4px; animation-delay: 0s; }
.pvt-voice-wave .bar:nth-child(2) { height: 8px; animation-delay: 0.12s; }
.pvt-voice-wave .bar:nth-child(3) { height: 12px; animation-delay: 0.24s; }
.pvt-voice-wave .bar:nth-child(4) { height: 8px; animation-delay: 0.36s; }
.pvt-voice-wave .bar:nth-child(5) { height: 4px; animation-delay: 0.48s; }
.pvt-tile.muted .pvt-voice-wave { display: none; }
@keyframes pvgWave { 0%,100%{transform:scaleY(0.3)} 50%{transform:scaleY(1)} }

.pvt-namebar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pvt-name {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pvt-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #22d3ee;
}
.pvt-mute-icon {
  font-size: 9px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
}
.pvt-you-badge {
  font-size: 8px;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.16);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 4px;
  flex-shrink: 0;
}

.pvg-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 20px;
  background: rgba(0,0,0,0.55);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pvg-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: rgba(255,255,255,0.11);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.11);
  width: 56px;
  height: 56px;
  font-size: 20px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
  position: relative;
}
.pvg-ctrl:hover { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.18); transform: translateY(-2px); }
.pvg-ctrl.active { background: rgba(37,99,235,0.2); border-color: rgba(37,99,235,0.45); }
.pvg-ctrl.danger { background: rgba(220,38,38,0.15); border-color: rgba(220,38,38,0.38); }
.pvg-ctrl.danger:hover { background: rgba(220,38,38,0.25); }
.pvg-ctrl-label {
  font-size: 8px;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.5);
  position: absolute;
  bottom: 6px;
  white-space: nowrap;
}
.pvg-ctrl-icon { margin-top: 8px; line-height: 1; }

#proj-video-consent {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(7,8,15,0.75);
}
#proj-video-consent.active { display: flex; }
.pvc-card {
  width: min(340px, calc(100% - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pvcSlideUp 0.35s var(--ease-spring);
}
@keyframes pvcSlideUp { from{transform:translateY(40px);opacity:0} to{transform:translateY(0);opacity:1} }
.pvc-icon { font-size: 40px; margin-bottom: 12px; }
.pvc-title {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: 6px;
}
.pvc-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.55;
}
.pvc-actions { display: flex; gap: 10px; }
.pvc-deny {
  flex: 1;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s, opacity 0.2s;
}
.pvc-deny:hover { border-color: var(--danger); color: var(--danger-light); }
.pvc-accept {
  flex: 1;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(79,70,229,0.35);
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s, opacity 0.2s;
}
.pvc-accept:hover { box-shadow: 0 6px 24px rgba(79,70,229,0.50); transform: translateY(-1px); }

.proj-call-member-video {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #818cf8;
}

html[data-theme="dev"] .pvt-tile { background: #050810; }
html[data-theme="dev"] .pvg-topbar,
html[data-theme="dev"] .pvg-controls {
  background: rgba(5,8,16,0.75);
  border-color: rgba(148,163,200,0.06);
}
html[data-theme="dev"] .pvg-ctrl { background: rgba(255,255,255,0.06); border-color: rgba(148,163,200,0.08); }
html[data-theme="dev"] .pvg-ctrl:hover { background: rgba(29,155,240,0.08); border-color: rgba(29,155,240,0.22); }
html[data-theme="dev"] .pvc-card { background: var(--surface); }

.proj-chat-msgs {
  flex: 1;
  display: block;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.proj-chat-msgs::-webkit-scrollbar { width: 4px; }
.proj-chat-msgs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.proj-msg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  align-items: flex-end;
}
.proj-msg-row.sent { flex-direction: row-reverse; }
.proj-msg-row.grouped { margin-bottom: 2px; }

.proj-msg-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(79,70,229,0.15));
  font-size: 9px; font-weight: 700; font-family: var(--font-mono);
  color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  transition: opacity var(--duration-fast);
}
.proj-msg-avatar:hover { opacity: 0.8; }
.proj-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.proj-msg-avatar.hidden { visibility: hidden; }

.proj-msg-content { max-width: 75%; display: flex; flex-direction: column; gap: 2px; }
.proj-msg-row.sent .proj-msg-content { align-items: flex-end; }

.proj-msg-sender {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-light);
  font-family: var(--font-mono);
  padding: 0 2px;
  cursor: pointer;
}
.proj-msg-sender:hover { text-decoration: underline; }

.proj-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.proj-msg-row.sent .proj-msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: var(--shadow-accent);
}
.proj-msg-bubble a { color: inherit; text-decoration: underline; opacity: 0.85; }

.proj-msg-time {
  font-size: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  padding: 0 4px;
}

.proj-msg-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-md);
  cursor: pointer;
  object-fit: cover;
  border: 1px solid var(--border);
}

.proj-date-divider {
  text-align: center;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.5px;
  padding: 8px 0;
  position: relative;
}
.proj-date-divider::before, .proj-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}
.proj-date-divider::before { left: 0; }
.proj-date-divider::after { right: 0; }

.proj-typing-bar {
  min-height: 18px;
  padding: 0 14px 2px;
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.proj-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.proj-chat-input-wrap {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-fast);
}
.proj-chat-input-wrap:focus-within { border-color: var(--border-focus); }
.proj-chat-textarea {
  width: 100%;
  min-height: 36px;
  max-height: 110px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.4;
}
.proj-chat-send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}
.proj-chat-send-btn:hover { transform: scale(1.08); }
.proj-chat-send-btn:disabled { opacity: 0.4; pointer-events: none; }
.proj-chat-img-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.proj-chat-img-btn:hover { border-color: var(--border-hover); color: var(--text); }

.proj-board-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.proj-board-wrap::-webkit-scrollbar { height: 4px; }
.proj-board-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.proj-kanban {
  display: flex;
  gap: 12px;
  height: 100%;
  min-width: max-content;
}

.proj-kanban-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 260px;
  flex-shrink: 0;
  min-height: 0;
}
.proj-kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.proj-kanban-col-title {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.proj-kanban-col-title .col-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.col-todo .col-dot { background: var(--muted); }
.col-doing .col-dot { background: var(--warning); }
.col-done .col-dot { background: var(--success); }

.proj-kanban-col-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}

.proj-kanban-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-height: 80px;
}
.proj-kanban-tasks::-webkit-scrollbar { width: 3px; }
.proj-kanban-tasks::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.proj-kanban-tasks.drag-over {
  background: rgba(37,99,235,0.04);
  border: 1px dashed rgba(37,99,235,0.28);
  border-radius: var(--radius-md);
}

.proj-task-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: grab;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  animation: skeletonFadeIn 0.3s var(--ease) both;
  position: relative;
}
.proj-task-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); transform: translateY(-1px); }
.proj-task-card:active { cursor: grabbing; }
.proj-task-card.dragging { opacity: 0.45; transform: rotate(1.5deg) scale(1.02); box-shadow: var(--shadow-lg); }
.proj-task-card.done-glow {
  border-color: rgba(5,150,105,0.35);
  box-shadow: 0 0 12px rgba(5,150,105,0.12);
}

.proj-task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
  margin-bottom: 5px;
  line-height: 1.35;
  word-break: break-word;
}
.proj-task-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.proj-task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.proj-task-assignee {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  min-width: 0;
  overflow: hidden;
}
.proj-task-assignee-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(79,70,229,0.15));
  font-size: 7px;
  font-weight: 700;
  color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.proj-task-assignee-avatar img { width: 100%; height: 100%; object-fit: cover; }
.proj-task-assignee-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.proj-task-move-btns {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.proj-task-move-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 22px; height: 22px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.proj-task-move-btn:hover { border-color: var(--accent); color: var(--accent); }

.proj-add-task-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: rgba(37,99,235,0.04);
  border: 1px dashed rgba(37,99,235,0.22);
  border-radius: var(--radius-md);
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.proj-add-task-btn:hover { background: rgba(37,99,235,0.09); }

.proj-task-empty {
  text-align: center;
  padding: 20px 12px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-display);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.proj-members-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.proj-members-wrap::-webkit-scrollbar { width: 4px; }
.proj-members-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.proj-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  cursor: pointer;
}
.proj-member-row:hover { border-color: var(--border-hover); }

.proj-member-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(79,70,229,0.15));
  font-size: 12px; font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.proj-member-avatar img { width: 100%; height: 100%; object-fit: cover; }

.proj-member-info { flex: 1; min-width: 0; }
.proj-member-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-member-role {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent-light);
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  display: inline-block;
  margin-top: 2px;
}
.proj-member-role.owner {
  color: var(--warning-light);
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.22);
}

.proj-member-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.proj-member-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.proj-member-action-btn:hover { border-color: var(--border-hover); color: var(--text); }
.proj-member-action-btn.danger { border-color: rgba(239,68,68,0.25); color: var(--danger-light); }
.proj-member-action-btn.danger:hover { background: rgba(239,68,68,0.08); }

.proj-requests-section {
  margin-top: 16px;
}
.proj-request-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.18);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.proj-request-row:hover { border-color: rgba(245,158,11,0.30); }

.proj-request-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(37,99,235,0.1));
  font-size: 11px; font-weight: 700;
  font-family: var(--font-mono);
  color: var(--warning-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.proj-request-avatar img { width: 100%; height: 100%; object-fit: cover; }

.proj-request-body { flex: 1; min-width: 0; }
.proj-request-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}
.proj-request-role-text {
  font-size: 10px;
  color: var(--warning-light);
  font-family: var(--font-mono);
  margin: 2px 0 4px;
}
.proj-request-msg {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}
.proj-request-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.proj-request-accept-btn {
  padding: 5px 12px;
  background: rgba(5,150,105,0.10);
  border: 1px solid rgba(5,150,105,0.28);
  color: var(--success-light);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.proj-request-accept-btn:hover { background: rgba(5,150,105,0.18); }
.proj-request-decline-btn {
  padding: 5px 12px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.22);
  color: var(--danger-light);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.proj-request-decline-btn:hover { background: rgba(239,68,68,0.14); }
.proj-request-dm-btn {
  padding: 5px 12px;
  background: rgba(37,99,235,0.07);
  border: 1px solid rgba(37,99,235,0.22);
  color: var(--accent-light);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.proj-request-dm-btn:hover { background: rgba(37,99,235,0.14); }

.proj-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: calc(var(--z-modal) + 2);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease);
}
.proj-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.proj-modal-sheet {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 540px;
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
  max-height: 88dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.proj-modal-sheet::-webkit-scrollbar { width: 4px; }
.proj-modal-sheet::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.proj-modal-overlay.open .proj-modal-sheet { transform: translateY(0); }

.proj-modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 10px auto 0;
}
.proj-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
}
.proj-modal-title {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
}
.proj-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.proj-modal-close:hover { border-color: var(--border-hover); color: var(--text); }
.proj-modal-body { padding: 0 18px 24px; }

.proj-modal-field { margin-bottom: 14px; }
.proj-modal-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.proj-menu-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-display);
  transition: background var(--duration-fast);
  border-bottom: 1px solid var(--border);
}
.proj-menu-option:last-child { border-bottom: none; }
.proj-menu-option:hover { background: rgba(37,99,235,0.05); }
.proj-menu-option.danger { color: var(--danger-light); }
.proj-menu-option.danger:hover { background: rgba(239,68,68,0.05); }
.proj-menu-option-icon { font-size: 16px; flex-shrink: 0; }

.proj-assignee-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  font-family: var(--font-display);
  outline: none;
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.proj-assignee-select:focus { border-color: var(--accent); }
html[data-theme="dev"] .proj-assignee-select option { background: #1E2732; }

.proj-pts-float {
  position: fixed;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--success-light);
  pointer-events: none;
  z-index: 500;
  animation: ptsFloatAnim 1.6s ease forwards;
  text-shadow: 0 0 10px rgba(16,185,129,0.55);
  padding: 4px 10px;
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-pill);
}

.proj-invite-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.proj-invite-link-text {
  flex: 1;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dev"] .projects-top { background: rgba(21,32,43,0.92); }
html[data-theme="dev"] .projects-tab-bar { background: rgba(21,32,43,0.92); }
html[data-theme="dev"] .projects-tab.active { color: #60BBEF; border-bottom-color: #1D9BF0; }
html[data-theme="dev"] .project-card { background: rgba(30,39,50,0.95); }
html[data-theme="dev"] .project-card:hover { border-color: rgba(29,155,240,0.24); box-shadow: 0 4px 20px rgba(29,155,240,0.08); }
html[data-theme="dev"] .project-card-cover { background: linear-gradient(135deg, rgba(29,155,240,0.12), rgba(139,92,246,0.09)); border-color: rgba(29,155,240,0.14); }
html[data-theme="dev"] .project-join-btn { border-color: rgba(29,155,240,0.24); color: #60BBEF; background: rgba(29,155,240,0.08); }
html[data-theme="dev"] .project-join-btn:hover { background: rgba(29,155,240,0.15); }
html[data-theme="dev"] .project-role-pill { color: #60BBEF; background: rgba(29,155,240,0.08); border-color: rgba(29,155,240,0.15); }
html[data-theme="dev"] .proj-create-topbar { background: rgba(21,32,43,0.92); }
html[data-theme="dev"] .proj-create-body { background: rgba(21,32,43,0.50); }
html[data-theme="dev"] .proj-type-card { background: rgba(30,39,50,0.90); }
html[data-theme="dev"] .proj-type-card.selected { border-color: rgba(29, 155, 240, 0.42); background: rgba(29, 155, 240, 0.07); }
html[data-theme="dev"] .proj-type-card:hover { border-color: rgba(29,155,240,0.20); }
html[data-theme="dev"] .proj-role-row { background: rgba(30,39,50,0.80); }
html[data-theme="dev"] .proj-role-row select,
html[data-theme="dev"] .proj-role-row input[type="number"] { background: rgba(255,255,255,0.06); border-color: rgba(29,155,240,0.12); color: var(--text); }
html[data-theme="dev"] .proj-ws-header { background: rgba(21,32,43,0.92); }
html[data-theme="dev"] .proj-ws-tab-bar { background: rgba(21,32,43,0.92); }
html[data-theme="dev"] .proj-ws-tab.active { color: #60BBEF; border-bottom-color: #1D9BF0; }
html[data-theme="dev"] .proj-msg-bubble { background: rgba(30,39,50,0.98); border-color: rgba(29,155,240,0.10); }
html[data-theme="dev"] .proj-msg-row.sent .proj-msg-bubble { background: linear-gradient(135deg, #1D9BF0, #1A8CD8); box-shadow: 0 4px 16px rgba(29,155,240,0.24); }
html[data-theme="dev"] .proj-chat-input-area { background: rgba(21,32,43,0.96); }
html[data-theme="dev"] .proj-chat-input-wrap { background: rgba(255,255,255,0.05); border-color: rgba(29,155,240,0.10); }
html[data-theme="dev"] .proj-kanban-col-header { background: rgba(30,39,50,0.95); }
html[data-theme="dev"] .proj-task-card { background: rgba(30,39,50,0.95); }
html[data-theme="dev"] .proj-task-card:hover { border-color: rgba(29,155,240,0.22); box-shadow: 0 4px 16px rgba(29, 155, 240, 0.07); }
html[data-theme="dev"] .proj-member-row { background: rgba(30,39,50,0.95); }
html[data-theme="dev"] .proj-member-role { color: #60BBEF; background: rgba(29,155,240,0.08); border-color: rgba(29,155,240,0.15); }
html[data-theme="dev"] .proj-request-row { background: rgba(245,158,11,0.04); border-color: rgba(245,158,11,0.15); }
html[data-theme="dev"] .proj-modal-sheet { background: rgba(21,32,43,0.99); border-color: rgba(29,155,240,0.10); }
html[data-theme="dev"] .proj-menu-option:hover { background: rgba(29, 155, 240, 0.05); }
html[data-theme="dev"] .proj-add-task-btn { border-color: rgba(29,155,240,0.20); color: #60BBEF; background: rgba(29, 155, 240, 0.04); }
html[data-theme="dev"] .proj-add-task-btn:hover { background: rgba(29, 155, 240, 0.09); }
html[data-theme="dev"] .proj-submit-wrap { background: linear-gradient(to top, rgba(21,32,43,0.98) 70%, transparent); }
html[data-theme="dev"] .projects-create-btn { background: linear-gradient(135deg, #1D9BF0, #1A8CD8); box-shadow: 0 4px 18px rgba(29,155,240,0.24); }
html[data-theme="dev"] .proj-chat-send-btn { background: linear-gradient(135deg, #1D9BF0, #1A8CD8); box-shadow: 0 4px 14px rgba(29,155,240,0.24); }
html[data-theme="dev"] .proj-kanban-tasks.drag-over { background: rgba(29, 155, 240, 0.04); border-color: rgba(29,155,240,0.20); }
html[data-theme="dev"] .proj-board-wrap { background: transparent; }
html[data-theme="dev"] .proj-invite-link-row { background: rgba(29, 155, 240, 0.04); border-color: rgba(29,155,240,0.10); }

@media (min-width: 1024px) {
  #projects-screen,
  #project-create-screen,
  #project-workspace-screen { height: 100%; }

  .proj-kanban-col { width: 290px; }
}

@media (max-width: 380px) {
  .proj-kanban { flex-direction: column; min-width: unset; }
  .proj-kanban-col { width: 100%; }
  .proj-board-wrap { overflow-x: hidden; overflow-y: auto; }
}



.pro-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 6px; border-radius: 999px;
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 60%, #8B5CF6 100%);
  color: #fff; font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  text-transform: uppercase; font-family: var(--font-mono);
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
  vertical-align: middle; flex-shrink: 0; user-select: none;
}

.user-item.is-pro {
  background: linear-gradient(var(--surface),var(--surface)) padding-box,
    linear-gradient(180deg,rgba(245,158,11,0.5),rgba(139,92,246,0.3)) border-box;
  border: 1px solid transparent !important;
}

.ups-avatar-outer.is-pro-user {
  box-shadow: 0 0 0 2.5px rgba(245,158,11,0.7), 0 0 22px rgba(245,158,11,0.28) !important;
}

.pro-status-panel {
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px;
  border: 1px solid rgba(245,158,11,0.35);
  background: linear-gradient(135deg,rgba(245,158,11,0.07),rgba(139,92,246,0.04));
}
.pro-status-panel.inactive { background: rgba(255,255,255,0.02); border-color: var(--border); }
.pro-status-title {
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  font-family: var(--font-mono); margin-bottom: 4px;
  background: linear-gradient(135deg,#F59E0B,#EF4444);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pro-status-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 10px; }
.pro-status-expiry { font-size: 11px; font-family: var(--font-mono); margin-bottom: 6px; }
.pro-upgrade-btn {
  width: 100%; padding: 11px; border-radius: var(--radius-md); border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg,#F59E0B,#EF4444,#8B5CF6); color: #fff;
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.pro-upgrade-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,158,11,0.5); }
.pro-upgrade-btn:disabled { opacity: 0.6; pointer-events: none; }
.pro-renew-btn {
  background: transparent; border: 1px solid rgba(245,158,11,0.45);
  color: #F59E0B; box-shadow: none;
}
.pro-renew-btn:hover { background: rgba(245,158,11,0.07); }

#pro-upgrade-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.6); opacity: 0; pointer-events: none; transition: opacity 220ms ease;
}
#pro-upgrade-modal.open { opacity: 1; pointer-events: all; }
.pro-modal-card {
  width: 100%; max-width: 500px;
  background: var(--surface); border: 1px solid rgba(245,158,11,0.22); border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 40px;
  transform: translateY(52px); transition: transform 300ms cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 -24px 64px rgba(0,0,0,0.35);
  max-height: min(92dvh, calc(100dvh - var(--safe-top))); overflow-y: auto;
}
#pro-upgrade-modal.open .pro-modal-card { transform: translateY(0); }
.pro-drag-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 0 auto 20px; display: block;
}
.pro-modal-hdr {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.pro-modal-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.4px;
  background: linear-gradient(135deg,#F59E0B,#EF4444);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pro-modal-x {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: none; cursor: pointer; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 140ms, color 140ms;
}
.pro-modal-x:hover { border-color: var(--border-hover); color: var(--text); }
.pro-price-row { display: flex; align-items: baseline; gap: 5px; margin-bottom: 18px; }
.pro-price-big { font-size: 38px; font-weight: 800; font-family: var(--font-mono); color: var(--text); }
.pro-price-per { font-size: 13px; color: var(--muted); }
.pro-bens { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
.pro-bens li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.pro-bens li .pi { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.pro-pay-btn {
  width: 100%; padding: 14px; border-radius: var(--radius-md); border: none; cursor: pointer;
  font-size: 15px; font-weight: 800; font-family: var(--font-display);
  background: linear-gradient(135deg,#F59E0B,#EF4444,#8B5CF6); color: #fff;
  box-shadow: 0 4px 20px rgba(245,158,11,0.4);
  transition: transform 140ms ease, box-shadow 140ms ease; letter-spacing: 0.2px;
}
.pro-pay-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,158,11,0.55); }
.pro-pay-btn:disabled { opacity: 0.6; pointer-events: none; }
.pro-modal-note {
  text-align: center; font-size: 10px; color: var(--muted);
  font-family: var(--font-mono); margin-top: 12px; line-height: 1.7;
}

.work-ad-card.is-featured {
  border: 1.5px solid rgba(245,158,11,0.5) !important;
  background: linear-gradient(var(--surface),var(--surface)) padding-box,
    linear-gradient(135deg,rgba(245,158,11,0.12),rgba(139,92,246,0.05)) border-box;
}
.featured-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  color: #F59E0B; font-size: 9px; font-weight: 700;
  font-family: var(--font-mono); letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 6px;
}

.community-card.is-pro-creator {
  border: 1px solid rgba(245,158,11,0.3) !important;
  position: relative;
}
.comm-pro-pin {
  position: absolute; top: 9px; right: 10px; font-size: 13px;
  pointer-events: none; opacity: 0.8;
}

.ups-tagline {
  font-size: 12px; color: var(--accent-light); font-style: italic;
  margin-top: 2px; line-height: 1.4;
}
.ups-pro-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px;
}
.ups-pro-since { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }

.pro-views-panel {
  background: rgba(245,158,11,0.05); border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 12px;
}
.pro-views-label {
  font-size: 9px; font-family: var(--font-mono); color: rgba(245,158,11,0.7);
  letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 4px;
}
.pro-views-count { font-size: 26px; font-weight: 800; color: var(--text); font-family: var(--font-mono); }
.pro-views-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.pro-field-wrap { display: flex; align-items: center; gap: 6px; }
.pro-badge-mini { font-size: 8px; padding: 1px 4px; }

.pro-dir-sep {
  font-size: 9px; font-family: var(--font-mono); letter-spacing: 1px;
  color: rgba(245,158,11,0.6); text-transform: uppercase;
  padding: 4px 12px; border-bottom: 1px solid rgba(245,158,11,0.1);
  background: rgba(245,158,11,0.03);
}

#call-quality-badge {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
#call-quality-badge.pro-hd {
  display: flex;
  background: linear-gradient(135deg, rgba(245,158,11,0.85), rgba(217,119,6,0.85));
  color: #fff;
  box-shadow: 0 2px 12px rgba(245,158,11,0.35);
}
#call-quality-badge.free-hd {
  display: flex;
  background: rgba(30,41,59,0.75);
  color: var(--muted);
  border: 1px solid var(--border);
}

#proj-call-quality-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
  display: none;
  vertical-align: middle;
}
#proj-call-quality-badge.pro-hd {
  display: inline-flex;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
}
#proj-call-quality-badge.free-hd {
  display: inline-flex;
  background: rgba(100,116,139,0.15);
  color: var(--muted);
}

.file-limit-pro-note {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #D97706;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}


:root .skel,
:root .skeleton-line {
  background: linear-gradient(
    100deg,
    #EEF1F6 0%,
    #EEF1F6 30%,
    #DDE3EE 48%,
    #E8EBF3 55%,
    #EEF1F6 70%,
    #EEF1F6 100%
  );
  background-size: 200% 100%;
}

:root .skeleton-card,
:root .skeleton-post,
:root .skel-post-card,
:root .skel-collab-card,
:root .skel-ups-post,
:root .skel-saved-post {
  background: #F2F5FA;
}

:root .skel-rec-pill {
  background: #F2F5FA;
}

body::before {
  background:
    radial-gradient(ellipse at 20% 0%,   rgba(35, 87, 232, 0.09),  transparent 55%),
    radial-gradient(ellipse at 85% 95%,  rgba(5, 150, 105, 0.045), transparent 50%),
    radial-gradient(ellipse at 60% 40%,  rgba(79, 112, 200, 0.04), transparent 65%);
}

html:not([data-theme="dev"]) body::after {
  background-image:
    radial-gradient(circle, rgba(35, 87, 232, 0.055) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
  background-size: 24px 24px, auto;
  opacity: 0.45;
}

@media (min-width: 1024px) {
  html:not([data-theme="dev"]) .desktop-sidebar {
    background:
      linear-gradient(180deg,
        rgba(240, 245, 255, 0.98) 0%,
        rgba(244, 247, 253, 0.97) 50%,
        rgba(238, 243, 251, 0.99) 100%
      );
    box-shadow: 1px 0 0 rgba(15, 23, 42, 0.06), 4px 0 20px rgba(15, 23, 42, 0.04);
    border-right: none;
  }
}

.post-card {
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

html[data-theme="dev"] .post-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
html[data-theme="dev"] .post-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

.post-skill-tag {
  background: rgba(35, 87, 232, 0.08);
  border-color: rgba(35, 87, 232, 0.16);
  color: var(--accent);
}
html[data-theme="dev"] .post-skill-tag {
  background: rgba(29, 155, 240, 0.08);
  border-color: rgba(29, 155, 240, 0.14);
  color: var(--accent-light);
}

.feed-section-label {
  font-size: 10px;
  letter-spacing: 1px;
  opacity: 0.7;
}

.mutual-badge {
  background: rgba(35, 87, 232, 0.07);
  border-color: rgba(35, 87, 232, 0.15);
  color: var(--accent-light);
}
html[data-theme="dev"] .mutual-badge {
  background: rgba(29, 155, 240, 0.06);
  border-color: rgba(29, 155, 240, 0.12);
  color: var(--accent-light);
}

.guild-msg-skill-tag {
  background: rgba(35, 87, 232, 0.06);
  border-color: rgba(35, 87, 232, 0.12);
  color: var(--muted);
}
html[data-theme="dev"] .guild-msg-skill-tag {
  background: rgba(29, 155, 240, 0.06);
  border-color: rgba(29, 155, 240, 0.10);
  color: var(--muted);
}

.ups-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.ups-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0;
  cursor: pointer;
  transition: color var(--duration-fast), border-bottom-color var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ups-tab-btn:hover {
  color: var(--text-secondary);
}
.ups-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.ups-work-panel {
  display: none;
  padding: 0 0 16px;
}
.ups-work-panel.visible {
  display: block;
}

.ups-add-work-wrap {
  display: none;
  margin-bottom: 12px;
}
.ups-add-work-wrap.visible {
  display: block;
}

.ups-add-work-btn {
  width: 100%;
  background: var(--surface);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  padding: 11px;
  color: var(--accent-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.ups-add-work-btn:hover {
  background: rgba(35, 87, 232, 0.04);
  border-color: rgba(35, 87, 232, 0.5);
}

.ups-portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ups-portfolio-empty {
  display: none;
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
}
.ups-portfolio-empty.visible {
  display: block;
}
.ups-portfolio-empty-hint {
  font-size: 11px;
  opacity: 0.6;
  display: block;
  margin-top: 4px;
}

.portfolio-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: calc(var(--z-modal) + 5);
}
.portfolio-modal-overlay.visible {
  display: block;
}

.portfolio-modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel-solid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 36px;
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.portfolio-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.portfolio-modal-title-text {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text);
}
.portfolio-modal-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: color var(--duration-fast);
}
.portfolio-modal-close-btn:hover { color: var(--text); }

.portfolio-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.portfolio-field {
  margin-bottom: 12px;
}
.portfolio-field:last-of-type { margin-bottom: 18px; }

.portfolio-tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.portfolio-tag-input-row {
  display: flex;
  gap: 6px;
}
.portfolio-tag-input-row .input { flex: 1; }

.portfolio-tag-add-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--accent-light);
  font-size: 12px;
  padding: 0 12px;
  cursor: pointer;
  font-family: var(--font-display);
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.portfolio-tag-add-btn:hover {
  background: rgba(35, 87, 232, 0.06);
  border-color: rgba(35, 87, 232, 0.3);
}

.portfolio-modal-error {
  display: none;
  font-size: 12px;
  color: var(--danger-light);
  margin-top: 8px;
  text-align: center;
}
.portfolio-modal-error.visible { display: block; }

.rooms-section-label,
.room-admin-section-label,
.feed-section-label {
  font-size: 10px;
  letter-spacing: 1.5px;
}

.room-type-pill,
.room-entry-pill,
.rooms-my-badge {
  font-size: 10px;
}

.post-expiry {
  font-size: 10px;
}

.guild-msg-skill-tag,
.guild-msg-time {
  font-size: 10px;
}

.guild-expiry-badge {
  font-size: 10px;
}

.story-label {
  font-size: 10px;
}

.ups-post-card-tag {
  font-size: 10px;
}

.follow-stat-lbl {
  font-size: 10px;
}

.post-priority-badge {
  font-size: 10px;
}

.room-member-role {
  font-size: 10px;
}

.saved-badge {
  font-size: 10px;
}

.badge {
  font-size: 10px;
}

.portfolio-modal-tag-chip {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(35, 87, 232, 0.12);
  color: var(--accent-light);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.portfolio-modal-tag-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--duration-fast);
}
.portfolio-modal-tag-remove:hover { color: var(--danger); }

@media (min-width: 1024px) {

  .nav-btn.active {
    position: relative;
    background: rgba(35, 87, 232, 0.07) !important;
    color: var(--accent) !important;
  }
  .nav-btn.active::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 3px !important;
    height: 60% !important;
    border-radius: 0 3px 3px 0 !important;
    background: var(--accent) !important;
    box-shadow: 0 0 10px rgba(35, 87, 232, 0.45) !important;
    animation: none !important;
  }

  .nav-btn:not(.active):hover {
    background: rgba(35, 87, 232, 0.05) !important;
    color: var(--text-secondary) !important;
    transform: translateX(2px) !important;
  }

  .nav-btn.create-btn.active::before,
  .nav-btn.create-btn:not(.active)::before {
    display: none !important;
  }
  .nav-btn.create-btn:not(.active):hover {
    transform: none !important;
  }

  .nav-btn .nav-label {
    font-size: 12px !important;
    font-family: var(--font-display) !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  html:not([data-theme="dev"]) .desktop-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 0 0 2px 2px;
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
  }

  html[data-theme="dev"] .nav-btn.active {
    background: rgba(29, 155, 240, 0.10) !important;
    color: var(--accent-light) !important;
  }
  html[data-theme="dev"] .nav-btn.active::before {
    background: var(--accent) !important;
    box-shadow: 0 0 12px rgba(29, 155, 240, 0.60) !important;
  }
  html[data-theme="dev"] .nav-btn:not(.active):hover {
    background: rgba(29, 155, 240, 0.05) !important;
    color: var(--text) !important;
    transform: translateX(2px) !important;
  }

  #user-list-screen .dir-search-combo {
    display: flex !important;
    width: 100%;
    min-height: 42px;
    flex-wrap: nowrap;
  }
  #user-list-screen .dir-combo-input {
    min-width: 0;
  }
  #main-nav > .nav-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 52px !important;
    min-height: 42px;
  }
  #main-nav > #chrome-bell-btn.nav-btn.chrome-bell-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 52px !important;
    min-height: 42px;
    height: auto !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
}

#nova-fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: var(--float-left-offset); /* ← left side: clears sidebar on desktop, avoids right-side chat/action UI */
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-accent-lg);
  z-index: 155;         /* ← below confirm/report modals (300–350) and lightbox (100→ no, 155 ok) */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-spring), opacity 0.2s var(--ease), visibility 0.2s;
}
#nova-fab:hover { transform: scale(1.08); }
#nova-fab:active { transform: scale(0.95); }

body:has(#chat-screen.active) #nova-fab,
body:has(#chat-screen.active) .nova-panel,
body:has(#room-chat-screen.active) #nova-fab,
body:has(#room-chat-screen.active) .nova-panel,
body:has(#story-viewer.active) #nova-fab,
body:has(#story-viewer.active) .nova-panel,
body:has(#story-create-modal.active) #nova-fab,
body:has(#story-create-modal.active) .nova-panel,
body:has(#sketch-board-overlay.active) #nova-fab,
body:has(#sketch-board-overlay.active) .nova-panel,
body:has(#call-overlay.active) #nova-fab,
body:has(#call-overlay.active) .nova-panel,
body:has(#proj-video-overlay.active) #nova-fab,
body:has(#proj-video-overlay.active) .nova-panel {
  display: none !important;
}

.nova-panel {
  position: fixed;
  bottom: calc(var(--nav-h) + 76px);
  left: var(--float-left-offset); /* ← matches FAB: opens from left side, clears sidebar */
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 154;         /* ← just below FAB so FAB stays on top */
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 70vh;
}
.nova-panel.open { display: flex; }

.nova-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
}
.nova-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.nova-close-btn {
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer; font-size: 16px;
  padding: 4px 8px; border-radius: 8px;
}
.nova-close-btn:hover { background: var(--border); }

.nova-messages {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 10px; min-height: 160px;
}
.nova-msg {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  max-width: 90%; word-break: break-word;
}
.nova-msg--ai {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.nova-msg--user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.nova-msg--thinking { opacity: 0.75; }

@keyframes nova-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes nova-dot-pop {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0px); }
  30%            { opacity: 1;    transform: translateY(-4px); }
}
.nova-thinking-bubble {
  display: flex; align-items: center; gap: 7px;
}
.nova-thinking-icon {
  display: inline-block;
  font-size: 15px;
  animation: nova-spin 1.4s linear infinite;
  flex-shrink: 0;
  color: var(--accent);
  line-height: 1;
  will-change: transform;
}
.nova-thinking-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  letter-spacing: 0.01em;
}
.nova-thinking-dots {
  display: inline-flex; gap: 2px; align-items: flex-end;
}
.nova-thinking-dots span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: nova-dot-pop 1.2s ease-in-out infinite;
}
.nova-thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.nova-thinking-dots span:nth-child(3) { animation-delay: 0.36s; }

.nova-input-row {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
#nova-input {
  flex: 1; padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg); color: var(--text);
  font-size: 14px; outline: none;
  font-family: var(--font-display);
}
#nova-input:focus { border-color: var(--accent); }
#nova-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#nova-send-btn:disabled { opacity: 0.4; cursor: default; }

.nova-screen-ctx {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(35,87,232,0.09); border: 1px solid rgba(35,87,232,0.18);
  font-size: 10px; font-family: var(--font-mono); color: var(--accent);
  letter-spacing: 0.5px; max-width: 160px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.3s, border-color 0.3s;
  cursor: default; user-select: none;
}
.nova-screen-ctx .ctx-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: ctx-pulse 2s ease-in-out infinite;
}
@keyframes ctx-pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}
html[data-theme="dev"] .nova-screen-ctx {
  background: rgba(29, 155, 240, 0.07); border-color: rgba(29,155,240,0.18);
}

.nova-suggestions {
  display: none; flex-direction: column; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out), opacity 0.25s;
  max-height: 0; opacity: 0;
}
.nova-suggestions.visible {
  display: flex; max-height: 200px; opacity: 1;
}
.nova-sugg-label {
  font-size: 9px; font-family: var(--font-mono); color: var(--muted);
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 8px 14px 4px;
}
.nova-sugg-chips {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px;
}
.nova-sugg-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--panel);
  font-size: 11.5px; font-family: var(--font-display); color: var(--text-secondary);
  cursor: pointer; transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease), opacity 0.18s var(--ease);
  white-space: nowrap; user-select: none;
}
.nova-sugg-chip:hover {
  background: rgba(35,87,232,0.08); border-color: rgba(35,87,232,0.32);
  color: var(--accent); transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.nova-sugg-chip:active { transform: scale(0.96); }
.nova-sugg-chip .chip-icon { font-size: 12px; }
html[data-theme="dev"] .nova-sugg-chip:hover {
  background: rgba(29,155,240,0.08); border-color: rgba(29,155,240,0.24);
}

.nova-parallel-strip {
  display: none; gap: 6px; flex-wrap: wrap;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  background: rgba(35,87,232,0.03);
  animation: fadeIn 0.2s var(--ease-out);
}
.nova-parallel-strip.visible { display: flex; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.nova-task-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 10px; font-family: var(--font-mono);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s, opacity 0.2s;
}
.nova-task-pill.running {
  border-color: rgba(35,87,232,0.35); color: var(--accent);
  background: rgba(35,87,232,0.07);
}
.nova-task-pill.running::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: task-spin-dot 0.8s linear infinite;
}
@keyframes task-spin-dot {
  0% { opacity:1; } 50% { opacity:0.3; } 100% { opacity:1; }
}
.nova-task-pill.done { border-color: rgba(5,150,105,0.3); color: var(--success); background: rgba(5,150,105,0.07); }
.nova-task-pill.done::before { content: '✓'; font-size: 9px; }
.nova-task-pill.error { border-color: rgba(220,38,38,0.3); color: var(--danger); background: rgba(220,38,38,0.07); }
.nova-task-pill.error::before { content: '✕'; font-size: 9px; }

.nova-nudge {
  position: fixed; bottom: calc(var(--nav-h) + 80px); right: 18px;
  max-width: 260px; z-index: calc(var(--z-toast) - 1);
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 12px 14px 10px; display: none; flex-direction: column; gap: 8px;
  animation: nudge-in 0.35s var(--ease-spring);
  pointer-events: all;
}
.nova-nudge.show { display: flex; }
@keyframes nudge-in {
  from { opacity:0; transform: translateY(12px) scale(0.93); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.nova-nudge-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-family: var(--font-mono); color: var(--accent);
  letter-spacing: 0.4px;
}
.nova-nudge-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; flex-shrink: 0;
}
.nova-nudge-text {
  font-size: 13px; color: var(--text); line-height: 1.45;
  font-family: var(--font-display);
}
.nova-nudge-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.nova-nudge-btn {
  font-size: 11.5px; padding: 4px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; font-family: var(--font-display);
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s; white-space: nowrap;
}
.nova-nudge-btn:hover {
  background: rgba(35,87,232,0.08); border-color: rgba(35,87,232,0.3);
  color: var(--accent);
}
.nova-nudge-btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.nova-nudge-btn.primary:hover {
  background: var(--accent-dark); border-color: var(--accent-dark); color: #fff;
}
.nova-nudge-dismiss {
  position: absolute; top: 8px; right: 10px;
  font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
  transition: color 0.15s;
}
.nova-nudge-dismiss:hover { color: var(--text); }
@media (min-width: 900px) {
  .nova-nudge { right: 32px; }
}

.nova-intent-preview {
  font-size: 10.5px; color: var(--muted); font-family: var(--font-mono);
  padding: 0 14px 6px; min-height: 0; transition: opacity 0.2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-group-sep { display: none; }   /* shown only inside @media (min-width:768px) */
.mobile-nav-only { display: none; } /* shown only inside @media (max-width:767px) */
#mobile-more-drawer { /* visibility controlled by .open class — no display:none */ }

@media (max-width: 767px) {
  :root { --nav-h: calc(62px + var(--safe-bottom)); }
  #main-nav {
    padding: 4px 4px calc(6px + var(--safe-bottom));
    height: var(--nav-h);
    justify-content: space-around;
  }
  .nav-btn {
    padding: 4px 8px 5px;
    min-width: 0;
    flex: 1;
    gap: 3px;
  }
  .nav-btn .nav-label {
    display: block !important;
    font-size: 10px !important;
    font-family: var(--font-display) !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }
  .nav-secondary { display: none !important; }
  .desktop-nav-sep { display: none !important; }
  .mobile-nav-only { display: flex !important; }
}

@media (min-width: 768px) {
  .mobile-nav-only { display: none !important; }
  .nav-secondary { display: flex !important; }
  .desktop-nav-sep {
    display: block !important;
    height: 1px;
    background: var(--border);
    margin: 5px 10px;
    opacity: 0.6;
    flex-shrink: 0;
  }
}

.nav-more-dot {
  position: absolute;
  top: 5px; right: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
  box-shadow: 0 0 6px rgba(35,87,232,0.6);
}
.nav-more-dot.visible { display: block; }

@media (min-width: 768px) {
  #nav-create {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 4px 14px rgba(35,87,232,0.25) !important;
    margin: 2px 0 !important;
    justify-content: center !important;
    transition: opacity 0.18s, box-shadow 0.18s, transform 0.18s !important;
  }
  #nav-create:hover {
    opacity: 0.92 !important;
    transform: none !important;
    box-shadow: 0 6px 22px rgba(35,87,232,0.40) !important;
  }
  #nav-create .nav-label { color: rgba(255,255,255,0.88) !important; }
  #nav-create.active::before { display: none !important; }
  html[data-theme="dev"] #nav-create {
    background: linear-gradient(135deg, #1D9BF0, #1A8CD8) !important;
    box-shadow: 0 4px 18px rgba(29,155,240,0.24) !important;
  }
}

#mobile-more-drawer {
  display: block; /* always in DOM — visibility controls hiding */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0; /* full screen so backdrop covers everything */
  z-index: var(--z-modal);
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0ms 320ms; /* hide after sheet slides out */
}
#mobile-more-drawer.open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0ms 0ms;
}
.more-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.30);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}
#mobile-more-drawer.open .more-drawer-backdrop { opacity: 1; }
.more-drawer-sheet {
  position: absolute;
  bottom: calc(var(--nav-h) + 10px);
  left: 12px;
  right: 12px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 20px 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.10);
  transform: translateY(calc(100% + var(--nav-h) + 10px));
  transition: transform 280ms cubic-bezier(0.25, 1, 0.5, 1);
}
#mobile-more-drawer.open .more-drawer-sheet { transform: translateY(0); }
.more-drawer-handle {
  display: none; /* floating card style — no drag handle needed */
}
.more-drawer-title {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 0 2px;
}
.more-drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.more-drawer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  position: relative;
}
.more-drawer-btn:active { transform: scale(0.94); }
.more-drawer-btn.active {
  background: rgba(35,87,232,0.08);
  color: var(--accent);
  border-color: rgba(35,87,232,0.22);
}
.more-btn-icon { font-size: 22px; line-height: 1; }
.more-btn-label {
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  white-space: nowrap;
}
html[data-theme="dev"] .more-drawer-sheet {
  background: var(--panel-solid);
  border-top-color: rgba(148,163,200,0.08);
}
html[data-theme="dev"] .more-drawer-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(148,163,200,0.08);
}
html[data-theme="dev"] .more-drawer-btn.active {
  background: rgba(29,155,240,0.10);
  color: var(--accent-light);
  border-color: rgba(29,155,240,0.22);
}



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

@supports not (height: 1dvh) {
  :root { --dvh-fallback: 1vh; }
  #app, .desktop-sidebar, .desktop-main {
    height: 100vh !important;
  }
  #login-screen { min-height: 100vh; }
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
}

@media (max-width: 319px) {
  :root {
    --content-px: 10px;
    --content-py: 10px;
  }

  .screen { padding: 10px; }

  #main-nav {
    padding: 2px 0 6px;
    gap: 0;
    justify-content: space-around;
  }
  .nav-btn {
    min-width: 0;
    flex: 1;
    padding: 5px 2px 4px;
    gap: 1px;
  }
  .nav-btn .nav-icon { font-size: 16px; }
  .nav-btn .nav-label { font-size: 7px; letter-spacing: 0; }
  .nav-btn.create-btn { padding: 5px 4px; }

  .dir-search-combo {
    flex-wrap: wrap;
    height: auto;
  }
  .dir-combo-select { width: 100%; max-width: 100%; border-top: 1px solid var(--border); }
  .dir-combo-sep { display: none; }
  .dir-online-btn { padding: 7px 8px; }
  .dir-online-btn span { display: none; }

  .filter-pill { padding: 3px 7px; font-size: 10px; }
  .explore-tab { font-size: 9px; padding: 4px 7px; }

  #login-screen { gap: 10px; padding-top: 16px; }
  .login-emblem { width: 64px; height: 64px; font-size: 24px; }
  .login-title { font-size: 22px; }

  .btn { padding: 12px 14px; font-size: 13px; }

  .onboard-welcome-brand { font-size: clamp(28px, 10vw, 42px); }
  .onboard-heading { font-size: 17px; }
  .skill-card-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }

  .confirm-modal-box,
  .portfolio-modal-sheet { width: calc(100vw - 16px); }

  .nova-panel { width: calc(100vw - 16px); left: 8px; }
  #nova-fab { left: 8px; width: 44px; height: 44px; }

  .more-drawer-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .more-btn-icon { font-size: 18px; }
  .more-btn-label { font-size: 9px; }
}

@media (max-width: 374px) {
  .dir-combo-select { width: 90px; min-width: 80px; font-size: 11px; }
  .dir-online-btn { padding: 8px 7px; font-size: 10px; }
  .dir-online-btn span { display: none; }

  .people-skill-pill { padding: 4px 8px; font-size: 10px; }

  #stories-scroll { gap: 6px; padding: 4px 8px; }
  .story-bubble { width: 34px; height: 34px; }
  .story-label { font-size: 6.5px; max-width: 34px; }

  .rec-card { min-width: 90px; padding: 9px 10px; }

  .chat-topbar { padding: 8px 10px; gap: 7px; }

  .ups-tab-btn { font-size: 11px; padding: 8px 0; }

  .more-drawer-sheet { padding: 10px 14px 16px; }
  .more-drawer-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .more-drawer-btn { padding: 10px 2px 8px; }
  .more-btn-label { font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-height: 480px) and (orientation: landscape) {
  :root {
    --nav-h: calc(48px + var(--safe-bottom));
    --content-py: 8px;
  }

  #main-nav {
    padding: 2px 4px calc(3px + var(--safe-bottom));
    height: var(--nav-h);
  }
  .nav-btn { padding: 3px 6px; gap: 2px; }
  .nav-btn .nav-icon { font-size: 17px; }
  .nav-btn .nav-label { font-size: 8px; }

  #login-screen {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    padding: 12px 16px;
    gap: 10px;
    overflow-y: auto;
  }
  .login-emblem { width: 60px; height: 60px; font-size: 22px; margin-bottom: 0; }
  .login-title { font-size: 22px; }
  .login-sub { font-size: 12px; }

  .explore-top { padding: 4px 10px 0; }
  .explore-top-row { margin-bottom: 4px; }
  .explore-filters { padding: 1px 0 5px; }

  #stories-scroll { padding: 3px 10px; }
  .story-bubble { width: 34px; height: 34px; }
  .story-label { display: none; }

  .rooms-top { padding: 6px 14px 6px; }
  .communities-top { padding: 5px 12px 0; }

  .dir-header { margin-bottom: 7px; }

  #nova-fab { width: 44px; height: 44px; bottom: calc(var(--nav-h) + 10px); }
  .nova-panel {
    max-height: calc(100vh - var(--nav-h) - 60px);
    bottom: calc(var(--nav-h) + 50px);
  }

  .more-drawer-sheet {
    bottom: calc(var(--nav-h) + 6px);
    max-height: 55vh;
    overflow-y: auto;
  }

  .ups-header { padding: 12px 16px 10px; }
}

@media (max-height: 360px) and (orientation: landscape) {
  :root { --nav-h: calc(42px + var(--safe-bottom)); }
  .nav-btn .nav-label { display: none !important; }
  .nav-btn { padding: 5px 8px; }
  .nav-btn .nav-icon { font-size: 18px; }
  #stories-scroll { display: none; }
  .explore-top { padding: 2px 8px 0; }
}

@media (min-width: 600px) and (max-width: 767px) {
  :root { --content-px: 18px; }

  .explore-top-row h2 { display: block; font-size: 15px; }

  .filter-pill { padding: 6px 13px; font-size: 12px; }

  .dir-combo-select { width: 115px; }
  .dir-online-btn span { display: inline; }

  .post-card { padding: 14px 16px; }

  .user-item { padding: 12px 14px; }

  .nav-btn { padding: 5px 8px 5px; min-width: 48px; }
  .nav-btn .nav-label { font-size: 9px; }

  .nova-panel { width: min(380px, calc(100vw - 40px)); }

  #toast { max-width: calc(100vw - 40px); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #user-list-screen .dir-search-combo {
    flex-wrap: nowrap;
    overflow: hidden;
  }
  #user-list-screen .dir-combo-select {
    width: 100px;
    min-width: 85px;
    max-width: 38%;
  }
  #user-list-screen .dir-online-btn span { display: none; }
  #user-list-screen .dir-online-btn { padding: 10px 9px; }

  #posts-feed { padding-left: 14px; padding-right: 14px; }

  #nova-fab { left: calc(var(--sidebar-w) + 16px); bottom: 24px; }
  .nova-panel {
    left: calc(var(--sidebar-w) + 16px);
    bottom: 100px;
    width: min(340px, calc(100vw - var(--sidebar-w) - 32px));
  }

  #notif-toast-banner {
    left: calc(var(--sidebar-w) + 50%);
    transform: translateX(-50%);
  }

  .explore-top-row h2 { display: block; }

  .ups-body { max-width: 600px; margin: 0 auto; }

  #room-chat-screen,
  #guild-screen {
    min-width: 0;
    overflow: hidden;
  }

  .proj-kanban-col { width: 260px; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --sidebar-w: clamp(260px, 22vw, 320px); }

  .nav-btn { padding: 9px 12px; }
  .nav-btn .nav-label { font-size: 11px; }

  #user-list-screen .dir-combo-select { width: 95px; min-width: 80px; }
  #user-list-screen .dir-online-btn { padding: 10px 8px; }
  #user-list-screen .dir-online-btn span { display: none; }

  #posts-feed { padding-left: 12px; padding-right: 12px; }

  .nova-panel { width: min(320px, calc(100vw - var(--sidebar-w) - 32px)); }

  .chrome { padding: 10px 14px 8px; }
  .chrome-logo { font-size: 13px; }
}

@media (min-width: 1280px) and (max-width: 1919px) {
  @supports (container-type: inline-size) {
    .desktop-main { container-type: inline-size; container-name: main-panel; }

    @container main-panel (min-width: 860px) {
      #posts-feed {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 12px;
        align-items: start;
      }
      .feed-section-label { grid-column: 1 / -1; }
    }
  }

  @media (min-width: 1400px) {
    #posts-feed { padding-left: 16px; padding-right: 16px; }
  }

  .nova-panel { width: min(380px, calc(100vw - var(--sidebar-w) - 40px)); }
}

@media (min-width: 1920px) {
  :root {
    --sidebar-w: clamp(360px, 18vw, 420px);
  }

  #shell {
    justify-content: center;
    background: var(--bg);
  }
  #app {
    max-width: 2000px;
    width: 100%;
  }

  @supports (container-type: inline-size) {
    @container main-panel (min-width: 1200px) {
      #posts-feed {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 14px;
      }
    }
  }

  .nav-btn { padding: 12px 16px; }
  .nav-btn .nav-label { font-size: 13px; }

  .chrome { padding: 14px 20px 12px; }

  #toast { max-width: min(600px, calc(100vw - var(--sidebar-w) - 48px)); }

  .nova-panel { width: 400px; }

  .dir-title { font-size: clamp(22px, 1.5vw, 28px); }
}

@media (min-width: 2560px) {
  :root { --sidebar-w: clamp(380px, 15vw, 460px); }
  #app { max-width: 2400px; }
  .nav-btn { padding: 14px 18px; }
  .nav-btn .nav-label { font-size: 14px; }
}

#login-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  width: 100%;
}

#login-screen input,
#login-screen .btn { box-sizing: border-box; }

@media (max-height: 640px) and (max-width: 767px) {
  #login-screen {
    gap: 10px;
    padding-top: 16px;
  }
  .login-emblem { width: 64px; height: 64px; font-size: 26px; margin-bottom: 0; }
  .login-emblem img { width: 44px; height: 44px; }
  .login-title { font-size: 24px; }
  .login-sub { font-size: 12px; }
  .tagline { margin-bottom: 12px; padding: 4px 10px; font-size: 9px; }
  .loading-logo { font-size: 36px; }
  .loading-sub { font-size: 9px; }
}

@media (max-height: 520px) and (max-width: 767px) {
  #login-screen {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 16px;
    gap: 8px;
  }
  .login-emblem { display: none; }
  .tagline { display: none; }
  .login-title { font-size: 20px; width: 100%; text-align: center; }
  .login-sub { display: none; }
}

@media (max-height: 700px) and (max-width: 767px) {
  .skill-card-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .skill-card { padding: 10px 6px; }
  .skill-card-emoji { font-size: 18px; }
  .skill-card-label { font-size: 11px; }
  .onboard-heading { font-size: 20px; }
  .onboard-sub { font-size: 13px; }
}

.dir-combo-input { min-width: 60px; }

.dir-search-combo {
  min-width: 0;
  width: 100%;
}

@media (max-width: 460px) {
  .dir-combo-select {
    width: 88px;
    min-width: 78px;
    max-width: 33%;
    font-size: 11.5px;
    padding-left: 6px;
  }
  .dir-search-icon { padding: 0 7px 0 10px; }
  .dir-combo-input { font-size: 13px; }
}

@media (max-width: 340px) {
  .dir-combo-sep { display: none; }
  .dir-combo-select {
    width: 72px;
    min-width: 0;
    padding: 8px 4px;
    font-size: 11px;
  }
  .dir-online-btn { display: none; }
}

.explore-top-row { flex-wrap: nowrap; min-width: 0; }
.explore-top-row .explore-search-wrap { min-width: 0; }

.explore-filters {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
  padding-right: 32px;
}
.filter-pill { scroll-snap-align: start; }

.explore-top-row--single {
  flex-wrap: nowrap;
  overflow: hidden;
}
.explore-search-wrap--combo { min-width: 0; }

.feed-sort-inline { min-width: 70px; }

@media (max-width: 767px) {
  #main-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
  }
  .nav-btn {
    flex: 1;
    min-width: 0;
    max-width: 80px;
    overflow: hidden;
  }
  .nav-btn .nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  #main-nav {
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
  }
  .nav-btn {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .nav-btn .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
}

.confirm-modal-box {
  max-height: min(90dvh, 90vh);
  overflow-y: auto;
}

.portfolio-modal-sheet {
  max-height: min(92dvh, 92vh);
}

.pro-modal-card {
  max-height: min(92dvh, 92vh);
}

.ups-body {
  max-height: min(96dvh, 96vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#notif-detail-sheet {
  max-height: min(92dvh, 92vh);
}

@media (min-width: 768px) {
  .pro-modal-card { max-width: 520px; }
}

.more-drawer-sheet {
  max-height: calc(100dvh - var(--nav-h) - 24px);
  max-height: calc(100vh - var(--nav-h) - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-select-popover {
  max-height: min(320px, 48dvh);
  max-height: min(320px, 48vh);
}

.chat-input-area {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.guild-input-area {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.room-input-area {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

#msgs-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.post-card {
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.user-item {
  min-width: 0;
  overflow: hidden;
}
.user-body { min-width: 0; }
.user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.user-top { flex-wrap: nowrap; min-width: 0; overflow: hidden; }

@media (min-width: 768px) and (max-width: 1279px) {
  .user-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    overflow: visible;
  }
  .user-name {
    width: 100%;
    max-width: 100%;
  }
  .meta-chips {
    line-height: 1;
  }
}

.room-card {
  min-width: 0;
  overflow: hidden;
}

.community-card {
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 360px) {
  .rec-card { min-width: 84px; }
}

.lb-row { min-width: 0; overflow: hidden; }
.lb-name { min-width: 0; }

#toast {
  max-width: min(560px, calc(100vw - var(--sidebar-w) - 32px));
  word-break: break-word;
  text-align: center;
}

#notif-toast-banner {
  max-width: min(480px, calc(100vw - 32px));
  word-break: break-word;
}

@media (min-width: 1024px) {
  #nova-fab {
    left: calc(var(--sidebar-w) + 20px);
    bottom: 32px;
  }
  .nova-panel {
    left: calc(var(--sidebar-w) + 20px);
    bottom: 102px;
    width: min(380px, calc(100vw - var(--sidebar-w) - 40px));
    max-height: min(500px, 65dvh);
    max-height: min(500px, 65vh);
  }
}

@media (max-width: 767px) {
  .nova-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(420px, 60dvh);
    max-height: min(420px, 60vh);
    bottom: calc(var(--nav-h) + 68px);
  }
  #nova-fab {
    left: 12px;
    bottom: calc(var(--nav-h) + 14px);
  }
}

#scroll-bottom-btn {
  z-index: 10;
}

.proj-board-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .proj-kanban-col { width: 240px; }
}

@media (max-width: 399px) {
  .proj-kanban { flex-direction: column; min-width: unset; gap: 10px; }
  .proj-kanban-col { width: 100%; min-width: 0; }
  .proj-board-wrap { overflow-x: hidden; }
}

@media (min-width: 1280px) {
  #project-create-screen > * { max-width: 760px; }
  #room-create-screen > * { max-width: 760px; }
}

.dir-title,
.rooms-top-title,
.onboard-heading,
.login-title {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

@media (min-width: 1280px) {
  .dir-title { font-size: clamp(20px, 1.8vw, 26px); }
}

.section-label,
.chrome-version,
.loading-sub,
.more-btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#user-list-screen {
  min-width: 0;
  overflow-x: hidden;
}

.recs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.recs-scroll::-webkit-scrollbar { display: none; }

.section-sep {
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .desktop-main .screen {
    min-width: 0;
    max-width: 100%;
  }

  #explore-screen .explore-top { padding: 10px 16px 0; }

  #profile-modal {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@supports (env(fold-left) or spanning) {
  @media (spanning: single-fold-vertical) {
    #app {
      width: env(fold-left);
    }
  }
}

@media print {
  #shell { position: static; }
  #app { display: block; height: auto; overflow: visible; }
  .desktop-sidebar { display: none !important; }
  .desktop-main { display: block; height: auto; overflow: visible; }
  #main-nav { display: none !important; }
  .nova-panel, #nova-fab { display: none !important; }
  .screen { display: block !important; padding: 16px; }
  .screen:not(.active) { display: none !important; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

@media (max-width: 767px) and (hover: none) and (pointer: coarse) {
  .icon-btn,
  .back-btn,
  .chrome-bell-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .filter-pill { min-height: 36px; }
}

#login-screen > div[style*="max-width:340px"],
#login-screen > div[style*="max-width: 340px"] {
  max-width: min(340px, calc(100% - 20px)) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#login-screen div[style*="border-bottom"][style*="width:100%"],
#login-screen div[style*="border-bottom"][style*="width: 100%"] {
  width: 100% !important;
  max-width: min(340px, 100%) !important;
  box-sizing: border-box !important;
}

#login-screen div[style*="flex:1"][style*="height:1px"]:first-child {
  min-width: 0;
}



html {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(35, 87, 232, 0.18);
  color: var(--text);
}
html[data-theme="dev"] ::selection {
  background: rgba(29, 155, 240, 0.20);
}

*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.nav-btn:focus-visible,
.icon-btn:focus-visible,
.back-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
html[data-theme="dev"] *:focus-visible {
  outline-color: #60BBEF;
}

html:not([data-theme="dev"]) ::-webkit-scrollbar { width: 4px; height: 4px; }
html:not([data-theme="dev"]) ::-webkit-scrollbar-track { background: transparent; }
html:not([data-theme="dev"]) ::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.14);
  border-radius: 99px;
}
html:not([data-theme="dev"]) ::-webkit-scrollbar-thumb:hover {
  background: rgba(35, 87, 232, 0.28);
}

html[data-theme="dev"] ::-webkit-scrollbar { width: 4px; height: 4px; }
html[data-theme="dev"] ::-webkit-scrollbar-track { background: transparent; }
html[data-theme="dev"] ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 200, 0.10);
  border-radius: 99px;
}
html[data-theme="dev"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(29, 155, 240, 0.20);
}

.btn-primary:active {
  transform: scale(0.97) translateY(1px) !important;
  box-shadow: 0 2px 10px var(--glow-accent) !important;
}
.btn-ghost:active { transform: scale(0.97) !important; }
.btn-danger:active { transform: scale(0.97) !important; }

.nav-btn.active::after {
  content: '';
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 1px;
  animation: glx-dot-pop 220ms var(--ease-spring) both;
}
@keyframes glx-dot-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
html[data-theme="dev"] .nav-btn.active::after {
  background: #60BBEF;
  box-shadow: 0 0 6px rgba(29, 155, 240, 0.44);
}
.nav-btn.create-btn::after { display: none !important; }

.post-card {
  transition:
    transform var(--duration-normal) var(--ease),
    box-shadow var(--duration-normal) var(--ease),
    border-color var(--duration-fast) var(--ease) !important;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(35, 87, 232, 0.08) !important;
}
html[data-theme="dev"] .post-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(29, 155, 240, 0.10) !important;
}
.post-card:active {
  transform: translateY(0) scale(0.99) !important;
  transition-duration: 80ms !important;
}

.user-item {
  transition:
    background var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease) !important;
}
.user-item:hover { transform: translateX(2px) !important; }
.user-item:active { transform: translateX(1px) scale(0.99) !important; }

.room-card:hover { transform: translateY(-2px) !important; }
.room-card:active { transform: translateY(0) scale(0.99) !important; }

.rec-card:hover { transform: translateY(-3px) !important; }
.rec-card:active { transform: scale(0.96) !important; }

.avatar-btn:hover { transform: scale(1.06) !important; }
.avatar-btn:active { transform: scale(0.92) !important; transition-duration: 80ms !important; }

.nav-btn:active { transform: scale(0.88) !important; transition-duration: 80ms !important; }
.nav-btn.create-btn:active { transform: scale(0.93) translateY(1px) !important; }

html:not([data-theme="dev"]) #toast {
  background: rgba(12, 18, 36, 0.97) !important;
  border-color: rgba(35, 87, 232, 0.22) !important;
  box-shadow:
    0 16px 48px rgba(15, 23, 42, 0.30),
    0 4px 16px rgba(35, 87, 232, 0.10),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

.input:focus {
  box-shadow:
    0 0 0 3px var(--glow-accent-soft),
    0 1px 3px rgba(35, 87, 232, 0.06) !important;
}

@keyframes glx-logo-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.80; }
}
.loading-logo {
  animation:
    golexLogoReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    glx-logo-breathe 3s ease-in-out 0.9s infinite !important;
}

@keyframes glx-zap-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; filter: drop-shadow(0 0 5px currentColor); }
}
#connection-bar:not(.online) #connection-icon i {
  animation: glx-zap-pulse 1.3s ease-in-out infinite;
}

.login-emblem { animation: floatSlow 4.5s ease-in-out infinite !important; }

.skill-select-pill:active,
.filter-pill:active,
.people-skill-pill:active,
.goal-pill:active,
.avail-pill:active {
  transform: scale(0.94) !important;
  transition-duration: 80ms !important;
}

.back-btn:active { transform: scale(0.88) !important; transition-duration: 80ms !important; }
.icon-btn:active { transform: scale(0.88) !important; transition-duration: 80ms !important; }

.glx-skip-link {
  position: fixed;
  top: -100px; left: 16px;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  transition: top 0.2s var(--ease);
  box-shadow: var(--shadow-accent);
}
.glx-skip-link:focus { top: 16px; outline: 3px solid #fff; outline-offset: 2px; }

.community-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.community-card:active { transform: scale(0.99); transition-duration: 80ms; }

.notif-item:hover { transform: translateX(2px); }

.more-drawer-btn:active { transform: scale(0.95) !important; transition-duration: 80ms !important; }

.msg { animation-duration: 180ms !important; }

.onboard-progress-segment {
  transition: background 0.35s var(--ease), transform 0.35s var(--ease-spring) !important;
}
.onboard-progress-segment.active-seg { transform: scaleX(1.04); }

.pro-badge, [class*="pro-badge"], .pro-gold-badge {
  animation: glx-pro-shimmer 3.5s ease-in-out infinite;
}
@keyframes glx-pro-shimmer {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.28)); }
  50%       { filter: drop-shadow(0 0 7px rgba(245, 158, 11, 0.58)); }
}

.post-media img,
.post-media video {
  border-radius: var(--radius-sm) !important;
}

.send-btn:active {
  transform: scale(0.88) !important;
  transition-duration: 80ms !important;
}

.loading-fill {
  animation-duration: 2.4s !important;
  animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1) !important;
}

@media (min-width: 768px) {
  .desktop-sidebar .nav-btn {
    transition:
      background var(--duration-fast) var(--ease),
      color var(--duration-fast) var(--ease),
      transform var(--duration-fast) var(--ease) !important;
  }
  .desktop-sidebar .nav-btn:hover:not(:active) { transform: translateX(3px) !important; }
  .desktop-sidebar .nav-btn:active { transform: translateX(1px) scale(0.97) !important; }
}

.reaction-chip {
  transition:
    transform var(--duration-fast) var(--ease-spring),
    background var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease) !important;
}
.reaction-chip:active { transform: scale(0.88) !important; transition-duration: 80ms !important; }

.login-title,
.onboard-welcome-brand,
.loading-logo {
  letter-spacing: -0.01em;
}

#qr-modal {
  transition: transform 0.35s var(--ease-spring), opacity 0.25s var(--ease) !important;
}

#kbd-hint-panel {
  backdrop-filter: blur(24px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.6) !important;
}

img, video {
  -webkit-user-drag: none;
  user-drag: none;
}

.input::placeholder { opacity: 0.72; }

button, [role="button"], label[for], a { cursor: pointer; }

