/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html, body { height: 100%; overflow: hidden }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--ff-body);
  font-weight: 300;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* ── Titlebar ─────────────────────────────────────────────────────── */
.titlebar {
  height: 36px; flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  position: relative; z-index: 100;
}
.titlebar-title {
  font-family: var(--ff-display); font-size: 13px; font-weight: 400;
  color: var(--muted); letter-spacing: 0.04em;
}
.titlebar-title span { color: var(--rose); font-style: italic }
.titlebar-logo-icon { height: 16px; width: 16px; vertical-align: middle; margin-right: 4px; }
.titlebar-dots {
  display: flex; gap: 8px;
}
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.dot-icon {
  font-size: 9px; font-weight: 700; line-height: 1;
  color: rgba(0,0,0,0.6); opacity: 0; transition: opacity 0.15s;
  user-select: none; pointer-events: none;
}
.titlebar-dots:hover .dot-icon { opacity: 1 }
.dot-green { background: #28c840 }
.dot-green .dot-icon { font-size: 10px }
.dot-yellow { background: #ffbd2e }
.dot-yellow .dot-icon { font-size: 11px; margin-top: -1px }
.dot-red { background: #ff5f57 }
.dot-red .dot-icon { font-size: 12px; margin-top: -1px }

/* ── Close Confirmation Dialog ────────────────────────────────────── */
.close-dialog-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}
.close-dialog-overlay.visible {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}
.close-dialog {
  position: relative;
  width: 340px;
  background: linear-gradient(170deg, #1a1318 0%, #0f0d11 50%, #110e14 100%);
  border: 1px solid var(--rose-20);
  border-radius: 20px;
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(194, 105, 122, 0.08);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.close-dialog-overlay.visible .close-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.close-dialog-glow {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
  border-radius: 2px;
}
.close-dialog-icon {
  width: 48px; height: 48px; margin: 0 auto 16px;
  background: var(--rose-12);
  border: 1px solid var(--rose-20);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.close-dialog-icon svg {
  width: 22px; height: 22px; color: var(--rose);
}
.close-dialog-title {
  font-family: var(--ff-display);
  font-size: 22px; font-weight: 400;
  color: var(--text); margin: 0 0 6px;
}
.close-dialog-sub {
  font-size: 0.85rem; color: var(--dim); margin: 0 0 28px;
}
.close-dialog-actions {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}
.close-dialog-btn {
  width: 100%; padding: 12px 16px;
  border-radius: 12px; border: none;
  font-family: var(--ff-body); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.close-dialog-tray {
  background: var(--rose); color: #fff;
}
.close-dialog-tray:hover {
  background: var(--rose-hover);
  box-shadow: 0 4px 20px rgba(194, 105, 122, 0.3);
}
.close-dialog-quit {
  background: var(--rose-12); color: var(--dim);
  border: 1px solid var(--rose-20);
}
.close-dialog-quit:hover {
  background: var(--rose-15); color: var(--text);
}
.close-dialog-stay {
  background: none; border: none;
  color: var(--rose-dim); font-family: var(--ff-body); font-size: 0.8rem;
  cursor: pointer; padding: 6px 12px;
  transition: color 0.2s;
}
.close-dialog-stay:hover { color: var(--rose); }

html[data-theme="light"] .close-dialog {
  background: linear-gradient(170deg, #fff 0%, #f5f1ef 50%, #f0ebe8 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15), 0 0 60px rgba(176, 80, 104, 0.06);
}
html[data-theme="light"] .close-dialog-overlay.visible {
  background: rgba(0, 0, 0, 0.3);
}

/* ── App Shell ────────────────────────────────────────────────────── */
.app { display: flex; flex: 1; overflow: hidden }
.screen-content { display: none; flex: 1; overflow: hidden; opacity: 0 }
.screen-content.active { display: flex; animation: screenFadeIn 180ms ease-out forwards }
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(6px) }
  to   { opacity: 1; transform: none }
}

/* ── Icon Bar ─────────────────────────────────────────────────────── */
.icon-bar {
  width: 60px; flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 16px 0; gap: 4px;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted2); cursor: pointer;
  transition: all 0.15s; position: relative;
  border: none; background: transparent;
}
.icon-btn:hover { color: var(--cream); background: var(--bg3) }
.icon-btn.active { color: var(--rose); background: var(--rose-bg) }
.icon-btn.nav-disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none }
.icon-btn svg { width: 18px; height: 18px }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rose); border: 2px solid var(--bg);
  box-shadow: 0 0 4px var(--rose);
}
.icon-btn[data-unread]::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rose); border: 2px solid var(--bg);
  box-shadow: 0 0 4px var(--rose); z-index: 2;
}
.icon-spacer { flex: 1 }
.icon-avatar {
  margin-top: 8px; cursor: pointer;
  border-radius: 50%;
  transition: filter 0.15s;
}
.icon-avatar.active .avatar-frame::before { filter: brightness(1.4); }

/* ── Panel Sidebar ────────────────────────────────────────────────── */
.panel {
  width: 260px; flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-family: var(--ff-display); font-size: 16px;
  font-weight: 400; color: var(--cream);
}
.panel-sub { font-size: 11px; color: var(--muted); margin-top: 2px }
.panel-search { margin: 10px 10px 4px; position: relative }
.panel-search input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: 8px;
  padding: 7px 10px 7px 30px;
  font-family: var(--ff-body); font-size: 12px;
  color: var(--cream); outline: none;
  transition: border-color 0.15s;
}
.panel-search input::placeholder { color: var(--muted2) }
.panel-search input:focus { border-color: var(--rose-30) }
.panel-search-icon {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted2);
}
.panel-section { padding: 12px 8px 4px }
.panel-section-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted2); padding: 0 8px; margin-bottom: 6px;
}

/* ── Companion Item (shared: home, chat, browse panels) ───────────── */
.companion-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s; position: relative;
}
.companion-item:hover { background: var(--bg3) }
.companion-item.active { background: var(--rose-bg) }
.comp-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  flex-shrink: 0; position: relative;
}
.comp-avatar-img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 10px;
}
.comp-avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display); font-size: 14px;
  font-style: italic; color: var(--rose-dim);
  background: linear-gradient(135deg, var(--av-comp-dark), var(--av-comp-light));
}
/* Status indicator — uses status-indicator.css classes */
.comp-status {
  position: absolute; bottom: 1px; right: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2.5px solid var(--panel);
  transition: background-color 0.4s ease;
}
.comp-status.online { background: #22c55e; animation: status-pulse 2.5s ease-in-out infinite }
.comp-status.idle   { background: #f97316; animation: none }
.comp-status.busy   { background: #94252a; animation: none }
.comp-info { flex: 1; min-width: 0 }
.comp-name-row { display: flex; align-items: center; gap: 6px }
.comp-name {
  font-size: 13px; font-weight: 400; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comp-stage {
  font-size: 9px; padding: 1px 6px; border-radius: 99px;
  background: var(--rose-bg); color: var(--rose);
  letter-spacing: 0.03em; white-space: nowrap; flex-shrink: 0;
}
.comp-preview {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.companion-status-msg {
  transition: opacity 0.3s ease;
}
.companion-status-msg.updating {
  opacity: 0;
}
/* Sidebar status: allow wrapping instead of truncation */
.comp-preview.companion-status-msg {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.35;
}
/* Sidebar typing indicator (companion streaming) */
.comp-typing {
  display: flex; align-items: center; gap: 3px;
  margin-top: 2px;
}
.comp-typing span {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--rose-dim);
  animation: compTypeDot 1s ease-in-out infinite;
}
.comp-typing span:nth-child(2) { animation-delay: 0.15s }
.comp-typing span:nth-child(3) { animation-delay: 0.3s }
@keyframes compTypeDot { 0%, 80%, 100% { opacity: 0.3 } 40% { opacity: 1 } }
.comp-unread {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 4px var(--rose);
  animation: comp-unread-pulse 2s ease-in-out infinite;
}
@keyframes comp-unread-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--rose); }
  50% { opacity: 0.5; box-shadow: 0 0 8px var(--rose); }
}

/* ── Screen Topbar (shared across Home, Browse, Achievements, Hiscore, Galleries) */
.screen-topbar {
  min-height: 52px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 10px 16px; gap: 12px;
  position: relative; overflow: hidden;
}
.screen-topbar-gradient {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 50%; pointer-events: none;
  background: linear-gradient(90deg, var(--rose-04), transparent);
}
.screen-topbar-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--rose-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.screen-topbar-icon svg {
  width: 16px; height: 16px; color: var(--rose);
}
.screen-topbar-title {
  font-family: var(--ff-display); font-size: 16px;
  font-weight: 400; color: var(--cream);
  position: relative;
}
.screen-topbar-sub {
  font-size: 11px; color: var(--muted);
  position: relative; margin-top: 1px;
}
.screen-topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  position: relative;
}

/* ── App Back Button (shared across sub-screens) ─────────────────── */
.app-back-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 24px;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  pointer-events: none;
  margin-bottom: -32px;
  align-self: stretch;
  flex-shrink: 0;
}
.app-back-btn {
  pointer-events: all;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  font-family: inherit;
}
.app-back-btn:hover {
  color: var(--cream);
  border-color: var(--cream-15, rgba(232, 221, 211, 0.15));
  background: var(--bg4, #222228);
}
.app-back-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Main Content Area ────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg2) }
.main-topbar {
  height: 48px; flex-shrink: 0;
  border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.main-topbar-left { display: flex; align-items: center; gap: 8px }
.topbar-title {
  font-family: var(--ff-display); font-size: 17px;
  font-weight: 400; color: var(--cream);
}
.topbar-date { font-size: 12px; color: var(--muted) }
.main-topbar-right { display: flex; align-items: center; gap: 8px }

/* ── Content (scrollable) ─────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 24px }
.content::-webkit-scrollbar { width: 4px }
.content::-webkit-scrollbar-track { background: transparent }
.content::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

/* ── Buttons ──────────────────────────────────────────────────────── */
.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 400;
  cursor: pointer; border: none; transition: all 0.15s;
  font-family: var(--ff-body);
}
.topbar-btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border2);
}
.topbar-btn-ghost:hover { color: var(--cream); border-color: var(--cream-15) }
.topbar-btn-primary { background: var(--rose); color: #fff; border: 1px solid var(--rose) }
.topbar-btn-primary:hover { background: var(--rose-hover) }
.topbar-btn svg { width: 14px; height: 14px }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 18px 20px;
}
.card-title {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}

/* ── Stat Cards ───────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 14px; padding: 16px 18px;
}
.stat-val {
  font-family: var(--ff-display); font-size: 32px;
  font-weight: 300; color: var(--cream); line-height: 1;
}
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 6px }
.stat-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; margin-top: 8px; padding: 2px 8px;
  border-radius: 99px;
}
.stat-delta.up { background: var(--green-bg); color: var(--green) }
.stat-delta.rose { background: var(--rose-bg); color: var(--rose) }

/* ── XP Bar ───────────────────────────────────────────────────────── */
.xp-bar-wrap { margin-bottom: 12px }
.xp-bar-label { display: flex; justify-content: space-between; margin-bottom: 6px }
.xp-bar-stage { font-size: 12px; color: var(--cream); font-weight: 400 }
.xp-bar-val { font-size: 11px; color: var(--muted) }
.xp-bar-track { height: 4px; background: var(--border2); border-radius: 2px; overflow: hidden }
.xp-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--rose-dim), var(--rose)) }

/* ── Grids ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px }

/* ── Form Controls ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px }
.form-label { font-size: 12px; color: var(--muted); letter-spacing: 0.02em }
.form-input {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 11px 14px;
  font-family: var(--ff-body); font-size: 13px; font-weight: 300;
  color: var(--cream); outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--rose-40);
  background: var(--bg2);
}
.form-input::placeholder { color: var(--muted2) }
select.form-input {
  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 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px; cursor: pointer;
}
select.form-input option { background: var(--bg3); color: var(--cream) }

/* ── Theme Transition ─────────────────────────────────────────────── */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ── Utility ──────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Skeleton shimmer (shared) ────────────────────────────────────── */
.skel-shimmer {
  background: var(--cream-04);
  border-radius: 6px;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { opacity: 0.4 }
  50%  { opacity: 0.7 }
  100% { opacity: 0.4 }
}

/* ── Reveal stagger (list items) ──────────────────────────────────── */
.reveal-item {
  opacity: 0;
  animation: revealUp 0.3s ease-out forwards;
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(8px) }
  to   { opacity: 1; transform: translateY(0) }
}

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px) }
  to { opacity: 1; transform: translateY(0) }
}
@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) }
  to   { opacity: 1; transform: translateY(0) }
}

/* ── Shared modal system ─────────────────────────────────────────── *
 *
 * Family A  (centered confirmation / action):
 *   .modal-overlay > .modal-wrapper.modal--sm
 *     .modal-body--centered
 *       .modal-icon.modal-icon--rose  >  svg
 *       .modal-heading
 *       .modal-text
 *       .modal-actions > .modal-btn.modal-btn--cancel + .modal-btn.modal-btn--primary
 *
 * Family B  (panel with header + scrollable body):
 *   .modal-overlay > .modal-wrapper.modal--lg
 *     .modal-header > .modal-title + .modal-close > svg
 *     .modal-body--panel  >  [scrollable content]
 *     .modal-footer (optional) > .modal-btn*
 *
 * ──────────────────────────────────────────────────────────────────── */

/* Overlay */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}

/* Wrapper + size variants */
.modal-wrapper {
  background: var(--bg2); border-radius: 20px;
  border: 1px solid var(--border);
  max-height: 85vh; overflow: hidden;
  display: flex; flex-direction: column;
  transform: scale(0.96); animation: modalIn 0.2s ease forwards;
}
@keyframes modalIn { to { transform: scale(1); } }
.modal--sm  { width: 100%; max-width: 380px; }
.modal--md  { width: 100%; max-width: 440px; }
.modal--lg  { width: 100%; max-width: 540px; }
.modal--xl  { width: 100%; max-width: 640px; }

/* Header (Family B) */
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; flex-shrink: 0;
  border-bottom: 1px solid var(--border2);
}
.modal-title {
  font-family: var(--ff-display); font-size: 17px;
  font-weight: 400; color: var(--cream);
}
.modal-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}
.modal-close {
  width: 28px; height: 28px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border2);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--cream); border-color: var(--cream-15); background: var(--bg3); }
.modal-close svg { width: 14px; height: 14px; }

/* Body: centered (Family A) */
.modal-body--centered { padding: 32px; text-align: center; }

/* Body: panel (Family B) */
.modal-body--panel { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-body--panel::-webkit-scrollbar { width: 4px; }
.modal-body--panel::-webkit-scrollbar-track { background: transparent; }
.modal-body--panel::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px; }

/* Icon (Family A) */
.modal-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.modal-icon svg { width: 22px; height: 22px; }
.modal-icon--rose   { background: var(--rose-bg); color: var(--rose); }
.modal-icon--red    { background: var(--red-bg); color: var(--red); }
.modal-icon--blue   { background: rgba(96,165,250,0.1); color: var(--blue); }
.modal-icon--yellow { background: rgba(250,204,21,0.06); color: var(--yellow); }
.modal-icon--green  { background: rgba(52,211,153,0.1); color: #34d399; }

/* Heading + text */
.modal-heading {
  font-family: var(--ff-display); font-size: 20px;
  color: var(--cream); margin-bottom: 8px;
}
.modal-text {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  margin-bottom: 20px;
}
.modal-text:last-child { margin-bottom: 0; }

/* Footer (Family B, optional) */
.modal-footer {
  padding: 12px 18px 16px; flex-shrink: 0;
  border-top: 1px solid var(--border2);
  display: flex; align-items: center; gap: 10px;
}

/* Actions row */
.modal-actions { display: flex; gap: 10px; }

/* Buttons */
.modal-btn {
  flex: 1; padding: 11px; border-radius: 10px;
  font-size: 13px; font-family: var(--ff-body); font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.modal-btn--cancel {
  background: transparent; border: 1px solid var(--border2); color: var(--muted);
}
.modal-btn--cancel:hover { color: var(--cream); border-color: var(--dim); }
.modal-btn--primary {
  background: var(--rose); border: none; color: #fff;
}
.modal-btn--primary:hover:not(:disabled) { background: var(--rose-hover); }
.modal-btn--danger {
  background: var(--red); border: none; color: #fff;
}
.modal-btn--danger:hover:not(:disabled) { background: var(--red-hover); }
.modal-btn--blue {
  background: var(--blue); border: none; color: #fff;
}
.modal-btn--blue:hover:not(:disabled) { filter: brightness(1.1); }
.modal-btn--ghost {
  background: none; border: none; color: var(--muted);
  font-size: 12px; padding: 8px; flex: none;
}
.modal-btn--ghost:hover { color: var(--cream); }

/* ── Hide context menu ── */
.hide-ctx-menu {
  position: fixed; z-index: 9999;
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: 8px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 200px; animation: fadeScaleIn 0.12s ease-out;
}
@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.hide-ctx-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px; border: none; border-radius: 6px;
  background: none; color: var(--text-muted, #aaa);
  font-size: 13px; cursor: pointer; text-align: left;
}
.hide-ctx-item:hover {
  background: rgba(255,255,255,0.06); color: var(--cream, #eee);
}
.hide-ctx-item svg { flex-shrink: 0; opacity: 0.7; }

/* Overflow "..." button shared style */
.hide-overflow-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.45); color: rgba(255,255,255,0.8);
  cursor: pointer; font-size: 16px; line-height: 1; letter-spacing: 2px;
  backdrop-filter: blur(4px); transition: background 0.15s;
}
.hide-overflow-btn:hover { background: rgba(0,0,0,0.65); color: #fff; }

/* Warning / info boxes */
.modal-warning {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 12px; line-height: 1.5; margin-bottom: 16px;
}
.modal-warning svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.modal-warning--red {
  background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.15);
  color: var(--red-light);
}
.modal-warning--yellow {
  background: rgba(250,204,21,0.06); border: 1px solid rgba(250,204,21,0.15);
  color: var(--yellow);
}

/* ── Shared scrollbar ────────────────────────────────────────────── */
.scrollbar-thin::-webkit-scrollbar { width: 4px }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 10px; padding: 10px 20px;
  font-size: 13px; color: var(--cream);
  z-index: 9000; opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  max-width: 420px;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); color: var(--red) }
.toast.success { border-color: rgba(74, 222, 128, 0.3); color: var(--green, #4ade80) }

/* ── Inline style replacement classes ────────────────────────────── */
.lora-ready { color: var(--green) }
.lora-none { color: var(--dim) }
.lora-training { color: var(--rose) }
.progress-complete { background: var(--green) }
.voice-active { color: var(--rose) }

/* ── Report Modal ────────────────────────────────────────────────── */
.report-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
}
.report-modal-overlay.hidden { display: none }
.report-modal {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px;
  width: 400px; max-width: 90vw; max-height: 80vh; overflow-y: auto;
}
.report-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border2);
}
.report-modal-header h3 { font-size: 16px; font-weight: 500; color: var(--text) }
.report-modal-close {
  background: none; border: none; font-size: 20px; color: var(--muted);
  cursor: pointer; line-height: 1;
}
.report-modal-close:hover { color: var(--text) }
.report-modal-body { padding: 16px 20px }
.report-label { font-size: 13px; color: var(--muted); margin-bottom: 12px }
.report-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px }
.report-option {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--text); padding: 8px 12px;
  border: 1px solid var(--border2); border-radius: 8px; transition: border-color 0.2s;
}
.report-option:hover { border-color: var(--rose-dim) }
.report-option input[type="radio"] { accent-color: var(--rose) }
.report-details {
  width: 100%; min-height: 60px; padding: 10px 12px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--border2); border-radius: 8px;
  color: var(--text); resize: vertical; font-family: inherit;
}
.report-details::placeholder { color: var(--muted) }
.report-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border2);
}
.report-cancel-btn {
  padding: 8px 16px; font-size: 13px; border-radius: 8px; cursor: pointer;
  background: none; border: 1px solid var(--border2); color: var(--muted);
}
.report-cancel-btn:hover { color: var(--text) }
.report-submit-btn {
  padding: 8px 16px; font-size: 13px; border-radius: 8px; cursor: pointer;
  background: var(--rose); border: none; color: #fff; font-weight: 500;
}
.report-submit-btn:hover { opacity: 0.9 }
