/* ==========================================================================
   Interactive Launcher Demo — styled after LegendPC Fluent UI
   Scoped under .ld-* (shares product gold palette with site)
   ========================================================================== */

.launcher-demo-section {
  padding-bottom: 24px;
}

.launcher-demo-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.launcher-demo-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  margin: 0 auto 20px;
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.launcher-demo-hint kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text-primary);
  box-shadow: 0 1px 0 var(--border);
}

/* ---------- Window shell ---------- */
.ld-window {
  --ld-bg-primary: #f4f2eb;
  --ld-bg-secondary: #faf8f3;
  --ld-bg-tertiary: #ebe6db;
  --ld-bg-card: #ffffff;
  --ld-bg-hover: #f0ebe0;
  --ld-bg-active: #e5dfd2;
  --ld-text-primary: #1a1814;
  --ld-text-secondary: #5c5648;
  --ld-text-muted: #8a8270;
  --ld-accent: #b87a0a;
  --ld-accent-hover: #9a6608;
  --ld-accent-glow: rgba(184, 122, 10, 0.18);
  --ld-accent-text: #ffffff;
  --ld-accent-rgb: 184, 122, 10;
  --ld-green: #2d6b3a;
  --ld-green-glow: rgba(45, 107, 58, 0.16);
  --ld-red: #c42b1c;
  --ld-border: rgba(26, 24, 20, 0.07);
  --ld-hover-overlay: rgba(26, 24, 20, 0.04);
  --ld-nav-pill: rgba(184, 122, 10, 0.12);
  --ld-hero-start: #e8b018;
  --ld-hero-end: #b87a0a;
  --ld-shadow: 0 2px 4px rgba(26, 24, 20, 0.05), 0 0 2px rgba(26, 24, 20, 0.06);
  --ld-shadow-lg: 0 16px 48px rgba(26, 24, 20, 0.14), 0 0 1px rgba(26, 24, 20, 0.08);
  --ld-radius: 6px;
  --ld-radius-md: 8px;
  --ld-radius-lg: 12px;
  --ld-sidebar: 88px;
  --ld-titlebar: 40px;
  --ld-font: "Segoe UI Variable", "Segoe UI", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;

  position: relative;
  display: flex;
  flex-direction: column;
  height: min(640px, 78vh);
  min-height: 520px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--ld-bg-primary);
  color: var(--ld-text-primary);
  font-family: var(--ld-font);
  box-shadow: var(--ld-shadow-lg), 0 0 0 1px rgba(184, 122, 10, 0.08);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.ld-window[data-ld-theme="dark"] {
  --ld-bg-primary: #1a1f1b;
  --ld-bg-secondary: #151a16;
  --ld-bg-tertiary: #252c26;
  --ld-bg-card: #262d27;
  --ld-bg-hover: #2e362f;
  --ld-bg-active: #384038;
  --ld-text-primary: #f5f2e8;
  --ld-text-secondary: rgba(245, 242, 232, 0.78);
  --ld-text-muted: rgba(245, 242, 232, 0.52);
  --ld-accent: #e8b018;
  --ld-accent-hover: #f0c440;
  --ld-accent-glow: rgba(232, 176, 24, 0.24);
  --ld-accent-text: #1a1408;
  --ld-accent-rgb: 232, 176, 24;
  --ld-green: #5cbf62;
  --ld-green-glow: rgba(92, 191, 98, 0.25);
  --ld-red: #ff99a4;
  --ld-border: rgba(245, 242, 232, 0.08);
  --ld-hover-overlay: rgba(245, 242, 232, 0.06);
  --ld-nav-pill: rgba(232, 176, 24, 0.16);
  --ld-hero-start: #f0c440;
  --ld-hero-end: #e8b018;
  --ld-shadow: 0 2px 4px rgba(0, 0, 0, 0.32), 0 0 2px rgba(0, 0, 0, 0.24);
  --ld-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.3);
}

/* Title bar */
.ld-titlebar {
  height: var(--ld-titlebar);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 14px;
  background: var(--ld-bg-secondary);
  border-bottom: 1px solid var(--ld-border);
}

.ld-titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ld-titlebar-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
}

.ld-titlebar-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  letter-spacing: 0.02em;
}

.ld-titlebar-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.ld-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
  background: var(--ld-green);
  box-shadow: 0 0 6px var(--ld-green-glow);
}

.ld-status-dot.busy {
  background: var(--ld-accent);
  box-shadow: 0 0 6px var(--ld-accent-glow);
  animation: ld-pulse 1s ease-in-out infinite;
}

@keyframes ld-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.ld-win-controls {
  display: flex;
  height: 100%;
  margin-left: 4px;
}

.ld-win-btn {
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ld-text-secondary);
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}

.ld-win-btn svg {
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.ld-win-btn:hover {
  background: var(--ld-hover-overlay);
  color: var(--ld-text-primary);
}

.ld-win-btn:active {
  background: var(--ld-bg-active);
}

.ld-win-btn.close:hover {
  background: #c42b1c;
  color: #fff;
}

.ld-win-btn.close:active {
  background: #a12015;
  color: #fff;
}

.ld-window.is-maximized {
  border-radius: 0;
  height: min(720px, 86vh);
}

.ld-window.is-minimized > .ld-titlebar,
.ld-window.is-minimized > .ld-body {
  display: none;
}

.ld-window.is-minimized {
  height: auto;
  min-height: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.ld-min-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  box-shadow: var(--ld-shadow-lg);
  color: var(--ld-text-primary);
  font-size: 13px;
  font-weight: 500;
}

.ld-min-chip[hidden] {
  display: none !important;
}

.ld-min-chip img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.ld-min-chip span {
  flex: 1;
  min-width: 0;
}

.ld-window.ld-close-flash {
  animation: ld-close-flash 0.28s ease;
}

@keyframes ld-close-flash {
  0% { filter: brightness(1); }
  40% { filter: brightness(0.72); }
  100% { filter: brightness(1); }
}

/* Body */
.ld-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.ld-sidebar {
  width: var(--ld-sidebar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--ld-bg-secondary);
  border-right: 1px solid var(--ld-border);
  padding: 10px 8px;
  overflow: hidden;
}

.ld-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  scrollbar-width: none;
}

.ld-sidebar-nav::-webkit-scrollbar { display: none; }

.ld-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--ld-border);
  padding-top: 8px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ld-nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 10px 6px 8px;
  border-radius: var(--ld-radius-md);
  color: var(--ld-text-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s;
  overflow: visible;
  flex-shrink: 0;
}

.ld-nav-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  margin-top: -8px;
  background: var(--ld-accent);
  border-radius: 0 2px 2px 0;
  opacity: 0;
}

.ld-nav-btn::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: var(--ld-radius-md);
  background: var(--ld-nav-pill);
  opacity: 0;
  z-index: 0;
  transition: opacity 0.15s;
}

.ld-nav-btn > * {
  position: relative;
  z-index: 1;
}

.ld-nav-btn:hover {
  color: var(--ld-text-primary);
}

.ld-nav-btn:hover::after {
  opacity: 1;
  background: var(--ld-hover-overlay);
}

.ld-nav-btn.active {
  color: var(--ld-accent);
}

.ld-nav-btn.active::before {
  opacity: 1;
}

.ld-nav-btn.active::after {
  opacity: 1;
  background: var(--ld-nav-pill);
}

.ld-nav-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ld-nav-btn .ld-arrow {
  width: 10px;
  height: 10px;
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.45;
  transition: transform 0.15s, opacity 0.15s;
}

.ld-nav-group.open .ld-arrow {
  transform: translateX(-50%) rotate(180deg);
  opacity: 0.75;
}

.ld-nav-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ld-submenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.18s ease;
  padding: 0;
}

.ld-nav-group.open .ld-submenu {
  max-height: 280px;
  opacity: 1;
  padding: 4px 0 6px;
}

.ld-sub-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 68px;
  min-height: 52px;
  color: var(--ld-text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s;
}

.ld-sub-btn svg {
  width: 16px;
  height: 16px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.ld-sub-btn:hover {
  color: var(--ld-text-primary);
}

.ld-sub-btn:hover svg {
  background: var(--ld-hover-overlay);
}

.ld-sub-btn.active {
  color: var(--ld-accent);
}

.ld-sub-btn.active svg {
  background: var(--ld-nav-pill);
  color: var(--ld-accent);
  box-shadow: 0 0 0 1px rgba(var(--ld-accent-rgb), 0.35);
}

/* Content */
.ld-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ld-bg-primary);
  padding: 22px 26px;
  overflow: hidden;
  position: relative;
}

.ld-page {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  animation: ld-page-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ld-page.active {
  display: flex;
}

@keyframes ld-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ld-page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--ld-bg-active) transparent;
}

.ld-page-scroll::-webkit-scrollbar { width: 8px; }
.ld-page-scroll::-webkit-scrollbar-thumb {
  background: var(--ld-bg-active);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ld-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.ld-page-header h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ld-text-primary);
  line-height: 1.2;
  margin: 0;
}

/* When subtitle/desc sits next to title in header, keep text block left-aligned */
.ld-page-header > h2 + .ld-page-desc,
.ld-page-header > h2 + .ld-page-subtitle {
  flex-basis: 100%;
  margin-top: -6px;
  order: 3;
}

.ld-page-header .ld-page-actions {
  margin-left: auto;
}

.ld-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--ld-radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  font-family: inherit;
  color: var(--ld-text-primary);
}

.ld-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ld-btn:active {
  transform: scale(0.98);
}

.ld-btn-primary {
  background: var(--ld-accent);
  color: var(--ld-accent-text);
  border-color: transparent;
}

.ld-btn-primary:hover {
  background: var(--ld-accent-hover);
  box-shadow: 0 2px 8px var(--ld-accent-glow);
}

.ld-btn-secondary {
  background: var(--ld-bg-card);
  border-color: var(--ld-border);
  color: var(--ld-text-primary);
}

.ld-btn-secondary:hover {
  background: var(--ld-bg-hover);
}

.ld-btn-lg {
  padding: 12px 24px;
  font-size: 14px;
  min-width: 148px;
}

.ld-btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.ld-btn-ghost {
  background: transparent;
  color: var(--ld-text-secondary);
}

.ld-btn-ghost:hover {
  background: var(--ld-hover-overlay);
  color: var(--ld-text-primary);
}

/* Tabs */
.ld-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--ld-bg-tertiary);
  border-radius: var(--ld-radius-md);
}

.ld-tab {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  transition: background 0.15s, color 0.15s;
}

.ld-tab:hover {
  color: var(--ld-text-primary);
}

.ld-tab.active {
  background: var(--ld-bg-card);
  color: var(--ld-accent);
  box-shadow: var(--ld-shadow);
}

/* Home */
/* Home — mirror LegendPC fluent-home-hero */
.ld-mount {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ld-fluent-home-hero {
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-lg);
  padding: 28px 30px;
  box-shadow: var(--ld-shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

.ld-fluent-home-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ld-accent), var(--ld-hero-end));
  pointer-events: none;
}

.ld-fluent-home-hero-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ld-fluent-home-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ld-accent);
}

.ld-fluent-home-hero-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ld-text-primary);
  margin: 0;
}

.ld-fluent-home-hero-desc {
  font-size: 13px;
  color: var(--ld-text-secondary);
  max-width: 420px;
  line-height: 1.5;
  margin: 0;
}

.ld-home-quick-actions {
  width: 100%;
}

.ld-card {
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-lg);
  box-shadow: var(--ld-shadow);
}

.ld-home-launch-card {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  align-items: center;
  gap: 16px 20px;
  padding: 16px 18px !important;
  background: var(--ld-bg-secondary);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: none;
}

.ld-home-launch-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border-radius: var(--ld-radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.ld-home-launch-left:hover {
  background: var(--ld-hover-overlay);
}

.ld-account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--ld-bg-tertiary);
  border: 1px solid var(--ld-border);
  display: block;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--ld-shadow);
  line-height: 0;
  font-size: 0;
}

.ld-account-avatar img,
.ld-account-avatar-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.ld-home-launch-left .ld-account-avatar {
  width: 52px;
  height: 52px;
}

.ld-home-launch-left .ld-account-avatar img,
.ld-home-launch-left .ld-account-avatar-img {
  width: 52px;
  height: 52px;
}

.ld-account-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ld-account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-account-type {
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-home-current-version-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: var(--ld-radius-md);
  border: 1px solid var(--ld-border);
  background: var(--ld-bg-card);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: var(--ld-shadow);
}

.ld-home-current-version-card:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--ld-accent-rgb), 0.2);
}

.ld-home-current-version-card:hover .ld-home-current-version-arrow {
  color: var(--ld-accent);
  transform: translateX(2px);
}

.ld-home-current-version-card .ld-version-item-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ld-home-current-version-card .ld-version-item-icon {
  width: 40px;
  height: 40px;
}

.ld-home-current-version-card .ld-version-item-icon .ld-version-icon-img {
  max-width: 36px;
  max-height: 36px;
}

.ld-home-current-version-arrow {
  width: 18px;
  height: 18px;
  color: var(--ld-text-muted);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

/* Version icon + badge (shared: home card, list, popover) */
.ld-version-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ld-version-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ld-version-icon-img {
  max-width: 36px;
  max-height: 36px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.ld-version-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ld-version-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.ld-version-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ld-v-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(var(--ld-accent-rgb), 0.14);
  color: var(--ld-accent);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.ld-v-badge.fabric {
  background: rgba(171, 71, 188, 0.15);
  color: #9c27b0;
}

.ld-window[data-ld-theme="dark"] .ld-v-badge.fabric {
  color: #ce93d8;
}

.ld-v-badge.forge {
  background: rgba(255, 152, 0, 0.15);
  color: #e65100;
}

.ld-window[data-ld-theme="dark"] .ld-v-badge.forge {
  color: #ffb74d;
}

.ld-v-badge.modpack {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
}

.ld-window[data-ld-theme="dark"] .ld-v-badge.modpack {
  color: #81c784;
}

.ld-v-badge.snapshot {
  background: rgba(33, 150, 243, 0.14);
  color: #1565c0;
}

.ld-window[data-ld-theme="dark"] .ld-v-badge.snapshot {
  color: #90caf9;
}

.ld-v-badge.special {
  background: rgba(233, 30, 99, 0.12);
  color: #c2185b;
}

.ld-window[data-ld-theme="dark"] .ld-v-badge.special {
  color: #f48fb1;
}

.ld-v-badge.old {
  background: rgba(121, 85, 72, 0.14);
  color: #6d4c41;
}

.ld-window[data-ld-theme="dark"] .ld-v-badge.old {
  color: #bcaaa4;
}

/* Legacy aliases kept for safety */
.ld-ver-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ld-ver-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ld-ver-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-ver-loader {
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-home-launch-right {
  min-width: 0;
}

.ld-quick-launch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ld-quick-launch .ld-btn-lg {
  min-width: 150px;
  padding: 12px 24px;
  font-size: 14px;
}

.ld-quick-launch .ld-btn-lg:hover {
  box-shadow: 0 2px 10px var(--ld-accent-glow);
}

.ld-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: var(--ld-nav-pill);
  color: var(--ld-accent);
  border: 1px solid rgba(var(--ld-accent-rgb), 0.2);
}

.ld-tag.muted {
  background: var(--ld-bg-tertiary);
  color: var(--ld-text-muted);
  border-color: transparent;
}

.ld-chevron {
  width: 16px;
  height: 16px;
  color: var(--ld-text-muted);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

/* Legacy aliases (older home markup) */
.ld-hero {
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-lg);
  padding: 28px 30px;
  box-shadow: var(--ld-shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ld-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ld-accent), var(--ld-hero-end));
  pointer-events: none;
}

.ld-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ld-accent);
}

.ld-hero-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 4px;
  color: var(--ld-text-primary);
}

.ld-hero-desc {
  font-size: 13px;
  color: var(--ld-text-secondary);
  margin-top: 6px;
  max-width: 420px;
}

.ld-launch-card {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  align-items: center;
  gap: 16px 20px;
  padding: 16px 18px;
  background: var(--ld-bg-secondary);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
}

.ld-home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.ld-stat {
  padding: 14px 16px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
}

.ld-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ld-accent);
  letter-spacing: -0.02em;
}

.ld-stat span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ld-text-muted);
}

/* Lists / cards */
.ld-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font-family: inherit;
}

.ld-item:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.28);
  background: var(--ld-bg-hover);
}

.ld-item.selected {
  border-color: rgba(var(--ld-accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--ld-accent-rgb), 0.18);
}

.ld-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ld-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ld-item-body {
  flex: 1;
  min-width: 0;
}

.ld-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-item-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ld-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Search */
.ld-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}

.ld-search svg {
  width: 15px;
  height: 15px;
  color: var(--ld-text-muted);
  flex-shrink: 0;
}

.ld-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ld-text-primary);
  font-size: 13px;
  font-family: inherit;
}

.ld-search input::placeholder {
  color: var(--ld-text-muted);
}

/* Switch */
.ld-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--ld-bg-active);
  border: 1px solid var(--ld-border);
  transition: background 0.18s, border-color 0.18s;
  flex-shrink: 0;
  cursor: pointer;
}

.ld-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.ld-switch.on {
  background: var(--ld-accent);
  border-color: transparent;
}

.ld-switch.on::after {
  transform: translateX(18px);
}

/* Settings */
.ld-settings-grid {
  display: grid;
  gap: 14px;
  max-width: 760px;
  padding-bottom: 8px;
}

.ld-setting-card {
  padding: 16px 18px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
}

.ld-setting-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ld-text-primary);
}

.ld-setting-row,
.ld-form-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ld-form-inline {
  padding: 4px 0 10px;
}

.ld-setting-label {
  min-width: 0;
  flex: 1;
}

.ld-setting-label strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-primary);
}

.ld-setting-label span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-form-group {
  margin-bottom: 14px;
}

.ld-form-group:last-child {
  margin-bottom: 0;
}

.ld-form-group > label:not(.ld-checkbox-label) {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ld-form-hint {
  display: block;
  font-size: 11.5px;
  color: var(--ld-text-muted);
  margin: 6px 0 0;
  line-height: 1.5;
  font-weight: 400;
}

.ld-input,
.ld-select,
.ld-textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--ld-radius);
  border: 1px solid var(--ld-border);
  background: var(--ld-bg-secondary);
  color: var(--ld-text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ld-input:focus,
.ld-select:focus,
.ld-textarea:focus {
  border-color: rgba(var(--ld-accent-rgb), 0.45);
  box-shadow: 0 0 0 3px var(--ld-accent-glow);
}

.ld-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.ld-select {
  cursor: pointer;
  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='%238a8270' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.ld-select-flex {
  flex: 1;
  min-width: 0;
}

.ld-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ld-input-row .ld-input,
.ld-input-row .ld-select {
  flex: 1;
  min-width: 0;
}

.ld-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(280px, 100%);
}

.ld-slider-full {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.ld-slider-full .ld-slider-value {
  text-align: left;
  min-width: 0;
}

.ld-slider {
  flex: 1;
  width: 100%;
  accent-color: var(--ld-accent);
  cursor: pointer;
}

.ld-slider-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ld-accent);
  min-width: 64px;
  text-align: right;
}

.ld-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0;
}

.ld-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ld-text-primary);
  cursor: pointer;
}

.ld-radio input {
  accent-color: var(--ld-accent);
  width: 15px;
  height: 15px;
}

.ld-mem-sys {
  padding: 12px;
  background: var(--ld-bg-secondary);
  border-radius: var(--ld-radius);
  margin-bottom: 12px;
}

.ld-mem-sys-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-mem-sys-row strong {
  font-size: 14px;
  color: var(--ld-text-primary);
}

.ld-mem-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--ld-bg-tertiary);
  overflow: hidden;
  margin: 8px 0;
}

.ld-mem-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ld-accent), var(--ld-hero-start));
}

.ld-mem-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--ld-bg-secondary);
  border-radius: var(--ld-radius);
}

.ld-mem-summary span {
  display: block;
  font-size: 12px;
  color: var(--ld-text-muted);
  margin-bottom: 4px;
}

.ld-mem-summary strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--ld-accent);
}

.ld-advanced-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.ld-advanced-toggle h3 {
  margin-bottom: 0;
}

.ld-adv-arrow {
  width: 18px;
  height: 18px;
  color: var(--ld-text-muted);
  transition: transform 0.18s ease;
}

.ld-adv-arrow.open {
  transform: rotate(180deg);
}

#ldAdvContent {
  margin-top: 14px;
  padding-top: 4px;
  border-top: 1px solid var(--ld-border);
}

.ld-callout {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--ld-radius);
  font-size: 12px;
  color: var(--ld-accent);
  background: rgba(var(--ld-accent-rgb), 0.08);
  border: 1px solid rgba(var(--ld-accent-rgb), 0.2);
  line-height: 1.5;
}

.ld-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.ld-theme-options,
.ld-wallpaper-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ld-theme-option,
.ld-wallpaper-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  min-width: 140px;
  border-radius: var(--ld-radius-md);
  border: 1px solid var(--ld-border);
  background: var(--ld-bg-secondary);
  color: var(--ld-text-primary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ld-wallpaper-option {
  min-width: 110px;
  align-items: center;
  text-align: center;
}

.ld-theme-option:hover,
.ld-wallpaper-option:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.35);
}

.ld-theme-option.active,
.ld-wallpaper-option.active {
  border-color: rgba(var(--ld-accent-rgb), 0.5);
  box-shadow: 0 0 0 1px rgba(var(--ld-accent-rgb), 0.2);
  background: var(--ld-nav-pill);
  color: var(--ld-accent);
}

.ld-theme-swatch {
  display: flex;
  gap: 6px;
}

.ld-theme-swatch i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ld-about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-theme-pills {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: var(--ld-bg-tertiary);
  border-radius: var(--ld-radius-md);
}

.ld-theme-pill {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ld-text-secondary);
}

.ld-theme-pill.active {
  background: var(--ld-bg-card);
  color: var(--ld-accent);
  box-shadow: var(--ld-shadow);
}

/* Console */
.ld-console {
  flex: 1;
  min-height: 0;
  background: #0f1412;
  color: #d8e0d8;
  border-radius: var(--ld-radius-md);
  border: 1px solid var(--ld-border);
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  overflow: auto;
}

.ld-window[data-ld-theme="light"] .ld-console {
  background: #1a1f1b;
}

.ld-log-line { white-space: pre-wrap; word-break: break-word; }
.ld-log-info { color: #9ad0a8; }
.ld-log-warn { color: #e8b018; }
.ld-log-dim { color: rgba(216, 224, 216, 0.55); }

/* Overlay launch */
.ld-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(244, 242, 235, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ld-window[data-ld-theme="dark"] .ld-overlay {
  background: rgba(26, 31, 27, 0.92);
}

.ld-overlay.show {
  display: flex;
  animation: ld-fade 0.2s ease;
}

@keyframes ld-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ld-overlay-card {
  width: min(360px, 90%);
  text-align: center;
  padding: 28px 24px;
}

.ld-overlay-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 24px var(--ld-accent-glow);
}

.ld-overlay-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ld-overlay-status {
  font-size: 12px;
  color: var(--ld-text-muted);
  min-height: 18px;
  margin-bottom: 16px;
}

.ld-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--ld-bg-active);
  overflow: hidden;
}

.ld-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ld-accent), var(--ld-hero-start));
  transition: width 0.18s linear;
}

/* Popover (version / account picker) */
.ld-popover {
  position: absolute;
  z-index: 30;
  display: none;
  min-width: 260px;
  max-width: 320px;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.ld-popover.show {
  display: block;
  animation: ld-page-in 0.16s ease;
}

.ld-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
  color: var(--ld-text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: background 0.12s;
}

.ld-popover-item:hover {
  background: var(--ld-hover-overlay);
}

.ld-popover-item.active {
  background: var(--ld-nav-pill);
  color: var(--ld-accent);
}

.ld-popover-avatar,
.ld-popover-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
  background: var(--ld-bg-tertiary);
  border: 1px solid var(--ld-border);
}

.ld-popover-avatar {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.ld-popover-icon {
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.ld-popover-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ld-popover-label {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-popover-sub {
  display: block;
  font-size: 11px;
  color: var(--ld-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-popover-item.active .ld-popover-sub {
  color: rgba(var(--ld-accent-rgb), 0.85);
}

/* Toast */
.ld-toast-host {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ld-toast {
  min-width: 200px;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 13px;
  color: var(--ld-text-primary);
  animation: ld-toast-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.ld-toast.success {
  border-color: rgba(45, 107, 58, 0.3);
}

.ld-toast.info {
  border-color: rgba(var(--ld-accent-rgb), 0.3);
}

@keyframes ld-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Demo badge ribbon */
.ld-demo-badge {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 5;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ld-accent);
  background: var(--ld-nav-pill);
  border: 1px solid rgba(var(--ld-accent-rgb), 0.25);
  pointer-events: none;
}

/* Empty / helper */
.ld-muted {
  color: var(--ld-text-muted);
  font-size: 13px;
}

.ld-empty,
.ld-empty-text {
  padding: 40px 16px;
  text-align: center;
  color: var(--ld-text-muted);
  font-size: 13px;
}

/* ---------- Form labels / controls (fix-tag polish) ---------- */
.ld-form-group > label,
.ld-filter-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ld-form-group > label.ld-checkbox-label,
.ld-checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ld-text-primary);
  line-height: 1.45;
}

.ld-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--ld-accent);
  cursor: pointer;
}

.ld-checkbox-label span {
  flex: 1;
  min-width: 0;
}

.ld-form-hint {
  display: block;
  font-size: 11.5px;
  color: var(--ld-text-muted);
  margin: 6px 0 0;
  line-height: 1.5;
  font-weight: 400;
}

.ld-form-group .ld-form-hint {
  margin-top: 6px;
}

.ld-card {
  padding: 18px 20px;
}

.ld-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ld-text-primary);
  letter-spacing: -0.01em;
}

.ld-settings-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  padding-bottom: 12px;
}

.ld-settings-container > .ld-card {
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
}

.ld-btn-block {
  width: 100%;
}

.ld-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ld-btn-danger {
  background: rgba(196, 43, 28, 0.1);
  color: var(--ld-red);
  border-color: rgba(196, 43, 28, 0.22);
}

.ld-btn-danger:hover {
  background: rgba(196, 43, 28, 0.16);
}

/* Page header extras */
.ld-page-header-accounts,
.ld-page-header-stack {
  align-items: flex-start;
  flex-direction: column;
  gap: 14px;
}

.ld-page-header-text {
  min-width: 0;
}

.ld-page-header-accounts {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.ld-page-subtitle,
.ld-page-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ld-text-muted);
  line-height: 1.45;
  font-weight: 400;
}

.ld-page-header-accounts .ld-page-actions {
  margin-left: auto;
}

/* ---------- Accounts page ---------- */
.ld-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.ld-account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ld-account-item:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.45);
  background: var(--ld-bg-hover);
}

.ld-account-item.selected {
  border-color: var(--ld-accent);
  box-shadow: 0 0 0 1px rgba(var(--ld-accent-rgb), 0.25), 0 0 16px var(--ld-accent-glow);
}

.ld-account-item .ld-account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.ld-account-item .ld-account-avatar img,
.ld-account-item .ld-account-avatar-img {
  width: 48px;
  height: 48px;
}

.ld-account-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ld-account-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ld-text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-account-item-type {
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-account-item-type.ms {
  color: var(--ld-accent);
}

.ld-account-item-type.offline {
  color: var(--ld-text-muted);
}

.ld-account-item-type.tp {
  color: #7c5cbf;
}

.ld-account-item .ld-tag {
  flex-shrink: 0;
}

/* ---------- Version list ---------- */
.ld-version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.ld-version-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ld-version-item:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.35);
  background: var(--ld-bg-hover);
}

.ld-version-item.selected {
  border-color: rgba(var(--ld-accent-rgb), 0.5);
  box-shadow: 0 0 0 1px rgba(var(--ld-accent-rgb), 0.18);
}

.ld-version-item .ld-version-item-icon {
  width: 40px;
  height: 40px;
}

.ld-version-item-body {
  flex: 1;
  min-width: 0;
}

.ld-version-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-version-item-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ld-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ld-version-item-status {
  font-size: 11px;
  color: var(--ld-green);
  font-weight: 500;
}

.ld-version-item-status.muted {
  color: var(--ld-text-muted);
  font-weight: 400;
}

.ld-version-item-actions {
  flex-shrink: 0;
}

/* Tabs */
.ld-tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: var(--ld-bg-secondary);
  border: 1px solid var(--ld-border);
  border-radius: 10px;
}

.ld-tab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.ld-tab-btn:hover {
  color: var(--ld-text-primary);
  background: var(--ld-hover-overlay);
}

.ld-tab-btn.active {
  background: var(--ld-bg-card);
  color: var(--ld-accent);
  box-shadow: var(--ld-shadow);
}

/* ---------- Mods / resource lists ---------- */
.ld-mod-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.ld-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ld-search-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--ld-radius-md);
  border: 1px solid var(--ld-border);
  background: var(--ld-bg-card);
  color: var(--ld-text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.ld-search-input:focus {
  border-color: rgba(var(--ld-accent-rgb), 0.45);
  box-shadow: 0 0 0 3px var(--ld-accent-glow);
}

.ld-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
}

.ld-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}

.ld-filter-label {
  margin-bottom: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ld-text-muted);
  text-transform: none;
  letter-spacing: 0.02em;
}

.ld-select-sm {
  height: 32px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  min-width: 110px;
}

.ld-mod-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.ld-mod-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
}

.ld-mod-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ld-bg-tertiary);
  border: 1px solid var(--ld-border);
  flex-shrink: 0;
}

.ld-mod-body {
  flex: 1;
  min-width: 0;
}

.ld-mod-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-mod-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ld-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.ld-page-info {
  font-size: 12px;
  color: var(--ld-text-muted);
  min-width: 40px;
  text-align: center;
}

/* ---------- LAN ---------- */
.ld-lan-container {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.ld-lan-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
}

.ld-lan-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ld-text-muted);
  box-shadow: 0 0 0 4px rgba(138, 130, 112, 0.12);
  flex-shrink: 0;
}

.ld-lan-status-info {
  min-width: 0;
}

.ld-lan-status-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
}

.ld-lan-status-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ld-text-muted);
}

.ld-lan-tabs {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: var(--ld-bg-secondary);
  border: 1px solid var(--ld-border);
  border-radius: 10px;
}

.ld-lan-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.ld-lan-tab.active {
  background: var(--ld-bg-card);
  color: var(--ld-accent);
  box-shadow: var(--ld-shadow);
}

.ld-lan-room-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ld-lan-steps {
  padding: 12px 14px;
  background: var(--ld-bg-secondary);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  font-size: 13px;
  color: var(--ld-text-secondary);
}

.ld-lan-steps-title {
  font-weight: 600;
  color: var(--ld-text-primary);
  margin-bottom: 8px;
}

.ld-lan-steps ol {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.5;
}

/* ---------- Toolbox ---------- */
.ld-toolbox-section {
  margin-bottom: 20px;
}

.ld-toolbox-category {
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-secondary);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.ld-toolbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.ld-toolbox-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
  text-align: left;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ld-toolbox-card:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.35);
  background: var(--ld-bg-hover);
}

.ld-toolbox-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--ld-bg-tertiary);
  border: 1px solid var(--ld-border);
  flex-shrink: 0;
}

.ld-toolbox-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ld-toolbox-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-primary);
}

.ld-toolbox-desc {
  font-size: 11px;
  color: var(--ld-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Java list ---------- */
.ld-java-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-java-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ld-bg-card);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius-md);
  box-shadow: var(--ld-shadow);
}

.ld-java-body {
  flex: 1;
  min-width: 0;
}

.ld-java-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text-primary);
}

.ld-java-path {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ld-text-muted);
  font-family: Consolas, "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-java-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ld-text-muted);
  line-height: 1.5;
}

/* Theme option name */
.ld-theme-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ld-text-secondary);
}

.ld-theme-option.active .ld-theme-name {
  color: var(--ld-accent);
}

/* Sidebar sub label */
.ld-sub-label {
  font-size: inherit;
}

/* Thanks list (about-like blocks if used) */
.ld-thanks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-thanks-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--ld-bg-secondary);
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius);
  font-size: 12px;
  color: var(--ld-text-muted);
  line-height: 1.45;
}

.ld-thanks-item strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ld-text-primary);
}

/* Console extras */
.ld-console-output {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ld-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.ld-console-wait {
  color: var(--ld-text-muted);
  font-style: italic;
}

/* Responsive */
@media (max-width: 900px) {
  .ld-launch-card,
  .ld-home-launch-card {
    grid-template-columns: 1fr;
  }

  .ld-quick-launch {
    justify-content: stretch;
  }

  .ld-quick-launch .ld-btn-lg {
    width: 100%;
  }

  .ld-home-stats {
    grid-template-columns: 1fr;
  }

  .ld-window {
    height: min(700px, 82vh);
  }
}

@media (max-width: 640px) {
  .ld-window {
    --ld-sidebar: 72px;
    min-height: 480px;
    border-radius: 12px;
  }

  .ld-content {
    padding: 14px 12px;
  }

  .ld-nav-btn {
    width: 60px;
    font-size: 10px;
    padding: 8px 4px 6px;
  }

  .ld-hero,
  .ld-fluent-home-hero {
    padding: 18px 16px;
  }

  .ld-hero-title,
  .ld-fluent-home-hero-title {
    font-size: 22px;
  }

  .ld-page-header h2 {
    font-size: 20px;
  }

  .ld-win-btn {
    width: 40px;
  }

  .ld-demo-badge {
    display: none;
  }
}

/* Website section chrome helpers */
.launcher-demo-footer-note {
  margin-top: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.launcher-demo-footer-note a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Phone: hide embedded interactive demo, show CTA to demo.html
   Tablet (>=769) + desktop: keep inline embed (same as desktop) */
.launcher-demo-mobile-cta {
  display: none;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
}

.launcher-demo-mobile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 28px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.launcher-demo-mobile-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.launcher-demo-mobile-copy h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.launcher-demo-mobile-copy p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.launcher-demo-mobile-btn {
  width: 100%;
  max-width: 280px;
}

/* Standalone demo page */
.demo-page-main .page-hero {
  padding-bottom: 8px;
}

.demo-page-section {
  padding-bottom: 48px;
}

body[data-page="demo"] .ld-window-demo-page {
  height: min(720px, calc(100dvh - var(--nav-h) - 220px));
  min-height: 520px;
}

@media (max-width: 768px) {
  /* Index: swap embed for mobile CTA */
  .launcher-demo-embed {
    display: none !important;
  }

  .launcher-demo-mobile-cta {
    display: block;
  }

  /* Full demo page: taller window for phone browsing */
  body[data-page="demo"] .ld-window-demo-page {
    height: min(780px, calc(100dvh - var(--nav-h) - 180px));
    min-height: 560px;
    border-radius: 12px;
  }

  body[data-page="demo"] .launcher-demo-wrap {
    padding: 0 10px;
  }

  body[data-page="demo"] .launcher-demo-hint {
    font-size: 0.82rem;
    margin-bottom: 12px;
  }
}

@media (min-width: 769px) {
  .launcher-demo-mobile-cta {
    display: none !important;
  }

  .launcher-demo-embed {
    display: block;
  }
}

/* ==========================================================================
   Demo home 3D skin doll (corner of launcher content)
   ========================================================================== */

.ld-home-skin-host {
  position: absolute;
  right: 8px;
  bottom: 0;
  z-index: 40;
  width: 160px;
  height: 210px;
  pointer-events: none;
  overflow: visible;
}

.ld-home-skin-host.is-hidden {
  display: none !important;
}

.ld-home-skin-host .skin-doll,
.ld-home-skin-host .ld-home-skin-doll {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 148px !important;
  height: 200px !important;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  pointer-events: none;
}

.ld-home-skin-host .skin-doll.is-full-body,
.ld-home-skin-host .ld-home-skin-doll.is-full-body {
  height: 230px !important;
  bottom: 8px;
  border-radius: 12px;
}

.ld-home-skin-host .skin-doll.is-half-body,
.ld-home-skin-host .ld-home-skin-doll.is-half-body {
  /* Slightly larger half-body so upper torso sits mid-frame */
  width: 160px !important;
  height: 210px !important;
  bottom: 0;
  border-radius: 12px 12px 0 0;
}

.ld-card-skin-doll h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ld-pill-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ld-accent-text);
  background: var(--ld-accent);
}

.ld-pill-badge-origin {
  color: var(--ld-accent);
  background: rgba(var(--ld-accent-rgb), 0.12);
  border: 1px solid rgba(var(--ld-accent-rgb), 0.28);
}

.ld-seg-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ld-seg-btns-wrap {
  gap: 6px;
}

.ld-seg-btn {
  appearance: none;
  border: 1px solid var(--ld-border);
  background: var(--ld-bg-secondary);
  color: var(--ld-text-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ld-seg-btn:hover {
  border-color: rgba(var(--ld-accent-rgb), 0.35);
  color: var(--ld-text-primary);
}

.ld-seg-btn.active {
  color: var(--ld-accent-text);
  background: var(--ld-accent);
  border-color: var(--ld-accent);
}

@media (max-width: 720px) {
  .ld-home-skin-host {
    width: 120px;
    height: 168px;
    right: 4px;
  }

  .ld-home-skin-host .skin-doll,
  .ld-home-skin-host .ld-home-skin-doll {
    width: 120px !important;
    height: 168px !important;
  }

  .ld-home-skin-host .skin-doll.is-full-body,
  .ld-home-skin-host .ld-home-skin-doll.is-full-body {
    height: 190px !important;
  }
}
