/* ==========================================================================
   Role Gate, Character Lobby & Modals Styles
   ========================================================================== */

/* Role Gate Modal */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
}

.gate-box {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gate-box h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 9vw, 72px);
  margin: 0;
  line-height: 1;
  letter-spacing: .02em;
}

.gate-box p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.gate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.gcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  text-align: left;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 12px);
  background: var(--panel);
  transition: all 0.15s ease;
}

.gcard:hover:not(:disabled) {
  border-color: var(--accent);
}

.gcard b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
}

.gcard small {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gcard span {
  font-size: 14px;
  color: var(--fg);
}

.gcard.dm b {
  color: var(--brass);
}

.gcard.last {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.gcard:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Master password form */
#g-pw[hidden] {
  display: none !important;
}

#g-pw:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

/* User Accounts & Characters */
.acctchip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.acctchip b {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
}

.authbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 12px);
  background: var(--panel);
}

.authbox label, .modal label.f {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.authbox .seg button {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 0;
}

.msg {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin: 0;
}

.char {
  border: 1px solid var(--line);
  border-left: 5px solid var(--cc, #7a828a);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--panel2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.char .chhead {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.char .chhead b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  letter-spacing: .02em;
}

.char .stats {
  gap: 10px;
  font-size: 11.5px;
}

.char .chnote {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  white-space: pre-wrap;
  max-height: 3.6em;
  overflow: hidden;
}

.pickbox {
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   Player Character Selection Lobby (Virtual TTG Style)
   ========================================================================== */
.lobby-box {
  width: min(1440px, 96vw);
  min-height: min(860px, 90vh);
  max-height: 94vh;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 12px);
  padding: 28px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
}

.lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-subtle);
}

.lobby-user-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.lobby-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.lobby-username {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: var(--r-sm, 5px);
  letter-spacing: 0.04em;
}

.lobby-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid var(--line);
  border-radius: var(--r-item, 7px);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lobby-logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.lobby-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-switch-dm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  color: var(--brass);
  border: 1px solid var(--line);
  border-radius: var(--r-item, 7px);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lobby-switch-dm-btn:hover {
  background: color-mix(in srgb, var(--brass) 24%, transparent);
  border-color: var(--brass);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brass-glow);
}

/* Empty State */
.lobby-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  text-align: center;
}

.lobby-empty-icon {
  font-size: 42px;
  opacity: 0.4;
  filter: grayscale(0.5);
}

.lobby-empty-text {
  margin: 0;
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Cards Grid */
.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 260px));
  justify-content: center;
  gap: 22px;
  padding: 20px 4px;
  flex: 1;
  max-height: calc(90vh - 190px);
  overflow-y: auto;
}

/* Portrait Character Card (4:6 aspect ratio) */
.lobby-char-card {
  aspect-ratio: 4 / 6;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg, 12px);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel2-solid);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.lobby-char-card:hover {
  border-color: var(--brass);
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 20px var(--brass-glow);
}

.lobby-char-card:active {
  transform: translateY(0);
}

.lobby-card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.92;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.lobby-char-card:hover .lobby-card-bg-img {
  transform: scale(1.05);
  opacity: 1;
}

.lobby-card-silhouette {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: 72%;
  height: 72%;
  pointer-events: none;
  opacity: 0.75;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.75));
  transition: transform 0.3s ease, opacity 0.25s ease;
}

.lobby-char-card:hover .lobby-card-silhouette {
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 0.95;
}

.lobby-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 13, 19, 0.25) 0%, rgba(8, 13, 19, 0.1) 42%, rgba(8, 13, 19, 0.88) 76%, rgba(8, 13, 19, 0.98) 100%);
  pointer-events: none;
}

.lobby-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-card-edit {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(15, 23, 34, 0.75);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.lobby-card-edit:hover {
  background: color-mix(in srgb, var(--brass) 28%, transparent);
  border-color: var(--brass);
  color: #fff;
  transform: scale(1.06);
}

.lobby-card-del {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(15, 23, 34, 0.75);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.lobby-card-del:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.45);
}

.lobby-card-text {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  pointer-events: none;
}

.lobby-card-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.1;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.lobby-card-meta {
  font-size: 12.5px;
  color: var(--brass);
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.lobby-card-meta .meta-dot {
  opacity: 0.6;
  font-size: 10px;
}

.lobby-card-vitals {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lobby-vital {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-sm, 5px);
  background: rgba(15, 23, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-vital.hp {
  color: #2ecc71;
}

.lobby-vital.ac {
  color: var(--brass);
}

.lobby-card-vitals .lobby-play-badge {
  margin-left: auto;
}

.lobby-play-badge {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: var(--r-sm, 5px);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transition: all 0.15s ease;
}

.lobby-char-card:hover .lobby-play-badge {
  background: var(--brass);
  color: #090d14;
}

/* Bottom Centered Gold Plus Button */
.lobby-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 14px;
}

.lobby-add-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 28px;
  background: var(--brass);
  color: #090d14;
  box-shadow: 0 6px 20px var(--brass-glow);
  margin: 16px auto 0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lobby-add-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px var(--brass-glow);
}

.lobby-add-btn:active {
  transform: scale(0.96);
}

/* Enhanced #charmodal styling - D&D 2024 Obsidian & Gold Character Creator */
.cm-box {
  width: min(780px, 95vw) !important;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #131a24 0%, #0c1219 100%) !important;
  border: 1px solid rgba(200, 166, 104, 0.35) !important;
  border-radius: var(--r-lg, 12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 28px rgba(200, 166, 104, 0.15) !important;
  padding: 20px 22px !important;
  gap: 14px !important;
}

.cm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(200, 166, 104, 0.2);
  padding-bottom: 10px;
}

.cm-head h2 {
  margin: 0;
  font-family: var(--font-display, 'Outfit', serif);
  font-size: 24px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.cm-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 3px;
}

.cm-section {
  background: rgba(18, 26, 36, 0.65);
  border: 1px solid rgba(200, 166, 104, 0.16);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cm-section-title {
  font-family: var(--font-body, 'Figtree', sans-serif);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass, #c8a668);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cm-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cm-mode-toggle {
  display: inline-flex;
  border-radius: 6px;
  background: rgba(8, 12, 17, 0.9);
  border: 1px solid rgba(200, 166, 104, 0.25);
  overflow: hidden;
}

.cm-mode-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cm-mode-btn.active {
  background: var(--brass, #c8a668);
  color: #0b1016;
  font-weight: 700;
}

.cm-info-badge {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(8, 12, 17, 0.85);
  border: 1px solid rgba(200, 166, 104, 0.18);
  font-size: 11.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.cm-skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.cm-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(200, 166, 104, 0.22);
  border-radius: 6px;
  font-size: 11.5px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.cm-skill-chip:hover:not(.disabled) {
  border-color: var(--brass, #c8a668);
  background: rgba(200, 166, 104, 0.1);
}
.cm-skill-chip.checked {
  border-color: var(--brass, #c8a668);
  background: rgba(200, 166, 104, 0.22);
  color: #fce7b0;
  font-weight: 600;
}
.cm-skill-chip.disabled {
  opacity: 0.65;
  border-style: dashed;
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.08);
  color: #5eead4;
  cursor: not-allowed;
}
.cm-skill-chip input {
  accent-color: var(--brass, #c8a668);
  cursor: pointer;
}

.cm-bg-asi-box {
  padding: 8px 10px;
  background: rgba(200, 166, 104, 0.07);
  border: 1px solid rgba(200, 166, 104, 0.22);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-bg-asi-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--brass, #c8a668);
}

.cm-bg-asi-selectors {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cm-asi-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.cm-asi-select {
  width: auto;
  min-width: 90px;
  padding: 3px 8px;
  font-size: 12px;
  height: 30px;
}

.cm-asi-hint {
  font-size: 11px;
  color: var(--brass-bright, #dfbe7d);
}

.cm-pb-budget-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(200, 166, 104, 0.1);
  border: 1px solid rgba(200, 166, 104, 0.25);
  font-size: 12px;
  color: #e2e8f0;
}
.cm-pb-budget-val {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  color: var(--brass-bright, #dfbe7d);
}
.cm-pb-hint {
  font-size: 11px;
  color: #94a3b8;
}
.cm-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #080d12;
  border: 1px solid rgba(200, 166, 104, 0.25);
  border-radius: 6px;
  padding: 2px 4px;
}
.cm-step-btn {
  width: 20px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}
.cm-step-btn:hover:not(:disabled) {
  background: var(--brass, #c8a668);
  color: #0b1016;
  border-color: var(--brass, #c8a668);
}
.cm-step-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.cm-step-val {
  min-width: 22px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.cm-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.cm-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #15202b 0%, #0d151e 100%);
  border: 1px solid rgba(200, 166, 104, 0.2);
  border-radius: 8px;
  padding: 8px 4px 6px;
  text-align: center;
  gap: 4px;
  min-height: 94px;
  box-sizing: border-box;
}

.cm-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--brass, #c8a668);
  letter-spacing: 0.06em;
}

.cm-stat-inp-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.cm-stat-select,
.cm-stat-manual-inp {
  width: 52px;
  text-align: center;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 0;
  height: 28px;
  border-radius: 4px;
  background: #080d12;
  border: 1px solid rgba(200, 166, 104, 0.3);
  color: #fff;
}

.cm-stat-total {
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
  font-family: monospace;
  line-height: 1.1;
}

.cm-stat-mod {
  font-size: 12px;
  font-weight: 700;
  color: var(--brass-bright, #dfbe7d);
}

.cm-stat-bonus-badge {
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  font-weight: 600;
}

.cm-weapon-detail {
  margin-top: 4px;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cm-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.cm-summary-pill {
  background: rgba(8, 12, 17, 0.85);
  border: 1px solid rgba(200, 166, 104, 0.22);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.cm-summary-pill .lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--sheet-text-muted, #94a3b8);
}

.cm-summary-pill .val {
  font-size: 18px;
  font-weight: 800;
  font-family: monospace;
  color: #f8fafc;
}

.cm-summary-pill .sub {
  font-size: 10px;
  color: var(--brass, #c8a668);
}

.cm-summary-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
}

.cm-create-btn {
  background: linear-gradient(135deg, #c8a668 0%, #a88444 100%) !important;
  color: #0b1016 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  padding: 10px 24px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(200, 166, 104, 0.4) !important;
  border: none !important;
  cursor: pointer;
}

.cm-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200, 166, 104, 0.6) !important;
}

@media (max-width: 700px) {
  .cm-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .cm-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cm-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm, 5px);
  transition: all 0.15s ease;
}

.cm-close-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.cm-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cm-avatar-preview {
  width: 58px;
  height: 58px;
  border-radius: var(--r-panel, 10px);
  border: 1px solid var(--line);
  background: var(--panel2-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.cm-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cm-avatar-placeholder {
  font-size: 26px;
  opacity: 0.5;
}

.cm-avatar-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-avatar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* Modal Dialogs */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 15, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal .box {
  width: min(400px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 12px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}

.modal h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: .02em;
}

