/* ==========================================================================
   APPLE DESIGN THEME (Cupertino Light / Liquid Glass)
   Grounded in Apple's Human Interface Guidelines (HIG) & dickwu/apple-design-skill:
   - System typography: SF Pro / Apple System font stack
   - Liquid Glass functional layer (nav, toolbars, sheets, modals, tooltips)
   - Solid, crisp light content layer (pure white cards, #f2f2f7 system canvas)
   - Apple Semantic Light Colors (System Blue #007AFF, Mint #34C759, Indigo #5856D6, etc.)
   - Squircles, continuous corner radii, subtle press scale micro-interactions
   ========================================================================== */

/* Apple Cupertino Light Overrides for Planner Top Action Buttons */
html[data-theme="apple"] .mr-header-actions .mr-btn {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html[data-theme="apple"] .mr-header-actions .mr-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.18);
  color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

html[data-theme="apple"] .mr-header-actions .mr-btn.primary {
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.35);
  color: #007aff;
}
html[data-theme="apple"] .mr-header-actions .mr-btn.primary:hover {
  background: rgba(0, 122, 255, 0.2);
  border-color: #007aff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

html[data-theme="apple"] .mr-header-actions .mr-btn.preset {
  background: rgba(255, 149, 0, 0.12);
  border-color: rgba(255, 149, 0, 0.35);
  color: #c97500;
}
html[data-theme="apple"] .mr-header-actions .mr-btn.preset:hover {
  background: rgba(255, 149, 0, 0.2);
  border-color: #ff9500;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.2);
}

html[data-theme="apple"] .mr-header-actions .mr-btn.import {
  background: rgba(88, 86, 214, 0.12);
  border-color: rgba(88, 86, 214, 0.35);
  color: #5856d6;
}
html[data-theme="apple"] .mr-header-actions .mr-btn.import:hover {
  background: rgba(88, 86, 214, 0.2);
  border-color: #5856d6;
  box-shadow: 0 2px 8px rgba(88, 86, 214, 0.2);
}

html[data-theme="apple"] .mr-header-actions .mr-btn.publish {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.35);
  color: #1e8238;
}
html[data-theme="apple"] .mr-header-actions .mr-btn.publish:hover {
  background: rgba(52, 199, 89, 0.2);
  border-color: #34c759;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.2);
}

html[data-theme="apple"] .mr-header-actions .mr-btn.clear {
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.3);
  color: #d70015;
}
html[data-theme="apple"] .mr-header-actions .mr-btn.clear:hover {
  background: rgba(255, 59, 48, 0.18);
  border-color: #ff3b30;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.2);
}
html[data-theme="apple"] {
  --bg: #f2f2f7;
  --bg-2: #e5e5ea;
  --glass: rgba(255, 255, 255, 0.82);
  --glass-2: rgba(242, 242, 247, 0.85);
  --panel: #ffffff;
  --panel-2: #f2f2f7;
  --panel-3: #e5e5ea;

  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.14);
  --edge: rgba(0, 0, 0, 0.06);

  --ink: #1c1c1e;
  --ink-2: #48484a;
  --muted: #636366;
  --faint: #8e8e93;

  /* Apple Semantic Light Accents */
  --cyan: #007aff;
  --violet: #5856d6;
  --accent: #007aff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 122, 255, 0.1);
  --accent-line: rgba(0, 122, 255, 0.35);

  --glow: 0 4px 16px rgba(0, 122, 255, 0.18);
  --glow-strong: 0 6px 24px rgba(0, 122, 255, 0.28);
  --holo: linear-gradient(135deg, #007aff 0%, #5856d6 50%, #af52de 100%);

  --k-item: #ff9500;
  --k-skill: #af52de;
  --k-quest: #007aff;
  --k-place: #34c759;
  --k-craft: #ff9500;
  --k-npc: #ff2d55;

  --g-common: #8e8e93;
  --g-rare: #34c759;
  --g-legend: #007aff;
  --g-unique: #ff9500;
  --g-epic: #af52de;
  --g-special: #ff3b30;

  --live: #34c759;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);

  /* Apple System Typography Stack */
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --grid-opacity: 0;
  --mote: rgba(0, 122, 255, 0.2);

  /* Compatibility bindings for wiki components */
  --bg-primary: #f2f2f7;
  --bg-secondary: #e5e5ea;
  --bg-card: #ffffff;
  --bg-card-hover: #f2f2f7;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(0, 122, 255, 0.35);
  --border-active: #007aff;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #475569;
  --gold-primary: #ff9500;
}

/* 2. Apple Ambient Light Canvas & Atmosphere */
html[data-theme="apple"] body {
  background-color: #f2f2f7 !important;
  color: #1c1c1e !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-theme="apple"] .bg {
  background: radial-gradient(ellipse 90% 55% at 50% -8%, rgba(0, 122, 255, 0.08), transparent 65%),
              radial-gradient(ellipse 65% 45% at 92% 85%, rgba(175, 82, 222, 0.05), transparent 60%),
              radial-gradient(ellipse 50% 35% at 8% 70%, rgba(52, 199, 89, 0.04), transparent 50%),
              #f2f2f7 !important;
}

html[data-theme="apple"] .bg::before,
html[data-theme="apple"] .bg::after {
  display: none !important;
}

/* 3. Liquid Glass Functional Layer: Navigation Rail & Topbar */
html[data-theme="apple"] .rail {
  background: rgba(255, 255, 255, 0.82) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cmd {
  background: rgba(255, 255, 255, 0.82) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .brand b {
  color: #1c1c1e !important;
}

html[data-theme="apple"] #crumb {
  color: #636366 !important;
}

html[data-theme="apple"] .rail-btn {
  border-radius: 12px !important;
  transition: all 0.18s cubic-bezier(0.25, 1, 0.5, 1) !important;
  color: #636366 !important;
}

html[data-theme="apple"] .rail-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .rail-btn.active {
  background: rgba(0, 122, 255, 0.12) !important;
  color: #007aff !important;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.15) !important;
}

/* 4. Global Typography & Inline Style Normalization */
html[data-theme="apple"] h1,
html[data-theme="apple"] h2,
html[data-theme="apple"] h3,
html[data-theme="apple"] h4,
html[data-theme="apple"] h5,
html[data-theme="apple"] h6,
html[data-theme="apple"] .brand b {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  letter-spacing: -0.022em;
  font-weight: 600;
  color: #1c1c1e !important;
}

html[data-theme="apple"] h1 {
  letter-spacing: -0.028em;
  color: #000000 !important;
}

html[data-theme="apple"] p,
html[data-theme="apple"] span:not(.btn *):not(.pill *):not(.badge *):not(.class-role):not(.active *),
html[data-theme="apple"] label,
html[data-theme="apple"] td,
html[data-theme="apple"] li,
html[data-theme="apple"] strong {
  color: #1c1c1e;
}

/* Override hardcoded inline white text on headings, descriptions, and containers */
html[data-theme="apple"] [style*="color:#fff"],
html[data-theme="apple"] [style*="color: #fff"],
html[data-theme="apple"] [style*="color:#ffffff"],
html[data-theme="apple"] [style*="color: #ffffff"],
html[data-theme="apple"] [style*="color: white"],
html[data-theme="apple"] [style*="color:white"] {
  color: #1c1c1e !important;
}

/* Keep white text on primary buttons, active pills, and live tags */
html[data-theme="apple"] .btn-primary,
html[data-theme="apple"] .btn-primary *,
html[data-theme="apple"] .cb-btn.primary,
html[data-theme="apple"] .cb-btn.primary *,
html[data-theme="apple"] .class-filter-pill.active,
html[data-theme="apple"] .class-filter-pill.active *,
html[data-theme="apple"] .cb-class-pill.active,
html[data-theme="apple"] .cb-class-pill.active *,
html[data-theme="apple"] .mode-btn.active,
html[data-theme="apple"] .mode-btn.active *,
html[data-theme="apple"] .map-layer-btn.active,
html[data-theme="apple"] .map-layer-btn.active *,
html[data-theme="apple"] .map-region-btn.active,
html[data-theme="apple"] .map-region-btn.active * {
  color: #ffffff !important;
}

/* Override hardcoded dark inline backgrounds */
html[data-theme="apple"] [style*="background:#090d16"],
html[data-theme="apple"] [style*="background:#070a12"],
html[data-theme="apple"] [style*="background:#0e131d"],
html[data-theme="apple"] [style*="background:#131c2b"],
html[data-theme="apple"] [style*="background:#111726"],
html[data-theme="apple"] [style*="background:#1c2637"],
html[data-theme="apple"] [style*="background:#080c16"] {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
}

/* 5. Spotlight Search & Inputs */
html[data-theme="apple"] .palette-trigger,
html[data-theme="apple"] .bigsearch {
  background: rgba(118, 118, 128, 0.12) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .palette-trigger:focus-within,
html[data-theme="apple"] .bigsearch:focus-within {
  border-color: #007aff !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  background: #ffffff !important;
}

html[data-theme="apple"] .palette-trigger kbd,
html[data-theme="apple"] .bigsearch kbd {
  background: #ffffff !important;
  color: #636366 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] input,
html[data-theme="apple"] select,
html[data-theme="apple"] textarea {
  border-radius: 10px !important;
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1c1c1e !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

html[data-theme="apple"] input::placeholder,
html[data-theme="apple"] textarea::placeholder {
  color: #8e8e93 !important;
}

html[data-theme="apple"] input:focus,
html[data-theme="apple"] select:focus,
html[data-theme="apple"] textarea:focus {
  outline: none !important;
  border-color: #007aff !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25) !important;
}

/* 6. Classes Hub & Archetype Cards (Fixes Dark Cards in Light Mode) */
html[data-theme="apple"] .classes-hero-banner,
html[data-theme="apple"] .dashboard-hero-banner {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .classes-hero-banner h1,
html[data-theme="apple"] .dashboard-hero-title {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .classes-hero-banner p,
html[data-theme="apple"] .dashboard-hero-desc {
  color: #48484a !important;
}

html[data-theme="apple"] .dashboard-hero-tag {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .class-filter-pill {
  background: rgba(118, 118, 128, 0.12) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #48484a !important;
}

html[data-theme="apple"] .class-filter-pill:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .class-filter-pill.active {
  background: #007aff !important;
  color: #ffffff !important;
  border-color: #007aff !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3) !important;
}

/* 6. Classes Hub & Archetype Cards (Enhanced Contrast & Visibility) */
html[data-theme="apple"] .classes-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 2rem !important;
}

html[data-theme="apple"] .class-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  overflow: hidden !important;
}

html[data-theme="apple"] .class-card:hover {
  border-color: #007aff !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.18) !important;
}

html[data-theme="apple"] .class-card.active {
  border: 2.5px solid #007aff !important;
  background: #ffffff !important;
  box-shadow: 0 8px 28px rgba(0, 122, 255, 0.25) !important;
}

/* Character Portrait Frame with rich contrast backdrop */
html[data-theme="apple"] .class-card-banner {
  height: 165px !important;
  background: linear-gradient(180deg, #242c3d 0%, #151c29 100%) !important;
  position: relative !important;
  overflow: hidden !important;
}

html[data-theme="apple"] .class-card-portrait {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: top center !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)) !important;
  transition: transform 0.4s ease !important;
}

html[data-theme="apple"] .class-card:hover .class-card-portrait {
  transform: scale(1.06) !important;
}

/* Subtle fade only at the very bottom into the white card body */
html[data-theme="apple"] .class-card-gradient {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, transparent 65%, rgba(255, 255, 255, 0.8) 88%, #ffffff 100%) !important;
  pointer-events: none !important;
}

html[data-theme="apple"] .class-card-info {
  background: #ffffff !important;
  padding: 1rem 1.15rem !important;
}

html[data-theme="apple"] .class-card-header {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  margin-bottom: 0.35rem !important;
}

html[data-theme="apple"] .class-emblem-mini {
  width: 32px !important;
  height: 32px !important;
  flex-shrink: 0 !important;
}

html[data-theme="apple"] .class-name {
  color: #1c1c1e !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.015em !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html[data-theme="apple"] .class-role {
  color: #007aff !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.35 !important;
  display: block !important;
}

html[data-theme="apple"] .class-tagline {
  color: #636366 !important;
  font-size: 0.82rem !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}

/* Class Detail Pane & Build Mode */
html[data-theme="apple"] .class-detail-container {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .class-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .class-avatar-box {
  background: linear-gradient(180deg, #242c3d 0%, #151c29 100%) !important;
  border: 1.5px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .class-avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: top center !important;
}

html[data-theme="apple"] .class-meta-title span {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .class-role-badge {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .class-weapon-tag {
  color: #636366 !important;
}

/* Flexible Build Mode Switcher (High Contrast Apple Segmented Style) */
html[data-theme="apple"] .mode-toggle {
  background: rgba(118, 118, 128, 0.12) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 980px !important;
  padding: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

html[data-theme="apple"] .mode-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 980px !important;
  padding: 7px 16px !important;
  color: #48484a !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  box-shadow: none !important;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

html[data-theme="apple"] .mode-btn svg {
  stroke: currentColor !important;
}

html[data-theme="apple"] .mode-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .mode-btn.active,
html[data-theme="apple"] .mode-btn.active.pve {
  background: #007aff !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35) !important;
}

html[data-theme="apple"] .mode-btn.active.pvp {
  background: #ff3b30 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.35) !important;
}

html[data-theme="apple"] .mode-btn.active:not(.pve):not(.pvp) {
  background: #5856d6 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(88, 86, 214, 0.35) !important;
}

/* Pros & Cons Boxes */
html[data-theme="apple"] .pro-con-box.pro-theme {
  background: rgba(52, 199, 89, 0.08) !important;
  border: 1px solid rgba(52, 199, 89, 0.25) !important;
}

html[data-theme="apple"] .pro-con-box.pro-theme h4 {
  color: #248a3d !important;
}

html[data-theme="apple"] .pro-con-box.con-theme {
  background: rgba(255, 59, 48, 0.08) !important;
  border: 1px solid rgba(255, 59, 48, 0.25) !important;
}

html[data-theme="apple"] .pro-con-box.con-theme h4 {
  color: #d70015 !important;
}

html[data-theme="apple"] .pro-con-box li {
  color: #3c3c43 !important;
}

/* Wakayashi Skill-Setup Section (Clear White Cards with Blue Accents) */
html[data-theme="apple"] .cg-panel {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-setup {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cg-detail-title h5 {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-detail-title h5 span {
  color: #007aff !important;
}

html[data-theme="apple"] .cg-detail-title small {
  color: #8e8e93 !important;
}

html[data-theme="apple"] .cg-detail-rank {
  background: #007aff !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3) !important;
}

html[data-theme="apple"] .cg-tag {
  background: rgba(118, 118, 128, 0.12) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-tag--type {
  background: rgba(0, 122, 255, 0.12) !important;
  color: #007aff !important;
  border-color: rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .cg-tag--weapon {
  background: rgba(255, 149, 0, 0.12) !important;
  color: #c97500 !important;
  border-color: rgba(255, 149, 0, 0.3) !important;
}

html[data-theme="apple"] .cg-detail-text {
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cg-detail-text p {
  color: #48484a !important;
}

html[data-theme="apple"] .cg-detail-sub {
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cg-detail-sub span {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-detail-sub span + span {
  color: #8e8e93 !important;
}

html[data-theme="apple"] .cg-specs li {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .cg-specs li:hover {
  background: rgba(0, 122, 255, 0.05) !important;
  border-color: rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .cg-specs li.is-pick {
  background: rgba(0, 122, 255, 0.08) !important;
  border-color: rgba(0, 122, 255, 0.35) !important;
}

html[data-theme="apple"] .cg-specs li.is-pick .cg-spec-text {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-slot {
  background: #e5e5ea !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="apple"] .cg-spec-level {
  color: #007aff !important;
}

html[data-theme="apple"] .cg-spec-text {
  color: #48484a !important;
}

html[data-theme="apple"] .cg-detail-note {
  background: rgba(0, 122, 255, 0.06) !important;
  border: 1px solid rgba(0, 122, 255, 0.2) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-detail-note b {
  color: #007aff !important;
}

html[data-theme="apple"] .cg-bar {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-bar span + span {
  color: #8e8e93 !important;
}

html[data-theme="apple"] .cg-level-tag--gold {
  background: rgba(255, 149, 0, 0.12) !important;
  color: #c97500 !important;
  border: 1px solid rgba(255, 149, 0, 0.3) !important;
}

html[data-theme="apple"] .cg-level-tag--mid {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .cg-level-tag--muted {
  background: rgba(118, 118, 128, 0.12) !important;
  color: #636366 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cg-tile {
  background: #f2f2f7 !important;
  border: 1.5px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .cg-tile:hover {
  border-color: #007aff !important;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2) !important;
}

html[data-theme="apple"] .cg-tile.is-selected {
  border: 2px solid #007aff !important;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3), 0 4px 12px rgba(0, 122, 255, 0.25) !important;
}

/* Hotbar & Rotation in Apple Light Mode */
html[data-theme="apple"] .cg-hotbar-panel {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cg-hotbar-group-card {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 12px !important;
}

html[data-theme="apple"] .cg-hotbar-group-title {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-hotbar-group-note {
  color: #636366 !important;
}

html[data-theme="apple"] .cg-hotbar-key-wrapper {
  background: #ffffff !important;
  border: 1.5px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .rotation-step {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 10px !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .rotation-step .step-num {
  background: #007aff !important;
  color: #ffffff !important;
}

html[data-theme="apple"] .rotation-step .step-name {
  color: #1c1c1e !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .stat-priority-badge,
html[data-theme="apple"] .stat-prio-tag {
  background: rgba(0, 122, 255, 0.1) !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
  color: #007aff !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .rookie-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .rookie-title {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .rookie-item {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 12px !important;
}

html[data-theme="apple"] .rookie-item-title {
  color: #1c1c1e !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .rookie-item-text {
  color: #48484a !important;
}

html[data-theme="apple"] .pro-con-box li {
  color: #3c3c43 !important;
}

/* Build Overview & Skill Cards */
html[data-theme="apple"] .build-overview-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .build-card-title {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .build-playstyle-desc {
  color: #48484a !important;
}

html[data-theme="apple"] .skill-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .skill-name {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .skill-desc {
  color: #48484a !important;
}

html[data-theme="apple"] .skill-badge {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #007aff !important;
}

/* 7. Daevanion Boards & Node Cards */
html[data-theme="apple"] .cg-daev,
html[data-theme="apple"] .cg-daev-grid,
html[data-theme="apple"] .cg-node-card,
html[data-theme="apple"] .cg-daev-container,
html[data-theme="apple"] .wakayashi-daev-root,
html[data-theme="apple"] .wakayashi-daev-frame,
html[data-theme="apple"] .stigma-tree,
html[data-theme="apple"] .stigma-col,
html[data-theme="apple"] .stigma-node {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cg-node-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cg-node-name {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-node-val {
  color: #007aff !important;
}

html[data-theme="apple"] .cg-daev-sum {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cg-board-tab-btn {
  background: rgba(118, 118, 128, 0.12) !important;
  color: #636366 !important;
}

html[data-theme="apple"] .cg-board-tab-btn.active {
  background: #007aff !important;
  color: #ffffff !important;
}

/* 8. Community Builds Section */
html[data-theme="apple"] .cb-hero-header {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cb-hero-left h1 {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cb-hero-left p {
  color: #636366 !important;
}

html[data-theme="apple"] .cb-filter-bar,
html[data-theme="apple"] .cb-views-bar {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 14px !important;
}

html[data-theme="apple"] .cb-class-pill,
html[data-theme="apple"] .cb-chip {
  background: rgba(118, 118, 128, 0.12) !important;
  color: #48484a !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .cb-class-pill.active,
html[data-theme="apple"] .cb-chip.active {
  background: #007aff !important;
  color: #ffffff !important;
  border-color: #007aff !important;
}

html[data-theme="apple"] .cb-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

html[data-theme="apple"] .cb-card-title {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cb-card-desc {
  color: #636366 !important;
}

html[data-theme="apple"] .cb-card-meta {
  color: #8e8e93 !important;
}

html[data-theme="apple"] .cb-card-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .cb-open-btn {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}

/* 9. Build Calculator / Planner */
html[data-theme="apple"] .metaroad-planner-root,
html[data-theme="apple"] .mr-build-header,
html[data-theme="apple"] .mr-choose-class-section,
html[data-theme="apple"] .planner-col,
html[data-theme="apple"] .mr-stats-card,
html[data-theme="apple"] .waka-hb-box,
html[data-theme="apple"] .tool-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .mr-build-title {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .mr-build-desc {
  color: #48484a !important;
}

html[data-theme="apple"] .mr-class-card {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .mr-class-card.active {
  background: #ffffff !important;
  border: 2px solid #007aff !important;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.2) !important;
}

html[data-theme="apple"] .mr-class-card-name {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .mr-class-card-role {
  color: #636366 !important;
}

html[data-theme="apple"] .mr-paperdoll-stage {
  background: radial-gradient(circle at center, #ffffff 0%, #f2f2f7 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .mr-char-name {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .mr-char-figure-box::after {
  background: linear-gradient(to top, #f2f2f7 0%, transparent 100%) !important;
}

html[data-theme="apple"] .mr-slot-box:not(.has-item) {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.2s ease, box-shadow 0.2s ease !important;
}

html[data-theme="apple"] .mr-slot-box:not(.has-item):hover {
  transform: translateY(-2px) scale(1.03) !important;
  border-color: #007aff !important;
  box-shadow: 0 6px 18px rgba(0, 122, 255, 0.2) !important;
}

html[data-theme="apple"] .mr-slot-label {
  color: #636366 !important;
}

html[data-theme="apple"] .planner-gear-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .planner-gear-card strong,
html[data-theme="apple"] .planner-gear-card span {
  color: #1c1c1e !important;
}

/* 5x12 In-game Hotbar */
html[data-theme="apple"] .aion-skill-grid-wrap,
html[data-theme="apple"] .waka-hb-box,
html[data-theme="apple"] .waka-macro-col,
html[data-theme="apple"] .waka-rot-col {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .aion-slot-cell {
  background: rgba(118, 118, 128, 0.08) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="apple"] .aion-slot-cell.has-skill {
  background: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .aion-slot-key {
  color: #1c1c1e !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="apple"] .aion-slot-lvl {
  color: #007aff !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

html[data-theme="apple"] .aion-grid-ctrl-btn,
html[data-theme="apple"] .aion-grid-info-btn {
  background: rgba(118, 118, 128, 0.12) !important;
  color: #1c1c1e !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .waka-hb-row {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .waka-slot,
html[data-theme="apple"] .action-slot {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

/* 10. Item Codex & Search Table */
html[data-theme="apple"] .filter-card,
html[data-theme="apple"] .table-container,
html[data-theme="apple"] .patch-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] table thead th {
  background: #f2f2f7 !important;
  color: #636366 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] table tbody tr:hover td {
  background: rgba(0, 122, 255, 0.04) !important;
}

html[data-theme="apple"] .item-name-cell b {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .stat-badge {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #1c1c1e !important;
}

/* 11. World, Pets, & Bosses */
html[data-theme="apple"] .pet-card,
html[data-theme="apple"] .boss-card,
html[data-theme="apple"] .zone-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .pet-name,
html[data-theme="apple"] .boss-name {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .pet-desc,
html[data-theme="apple"] .boss-desc {
  color: #48484a !important;
}

/* 12. Interactive Map & Sidebar */
html[data-theme="apple"] .map-topbar,
html[data-theme="apple"] .map-sidebar,
html[data-theme="apple"] .map-marker-popup {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .map-region-btn,
html[data-theme="apple"] .map-layer-btn {
  background: rgba(118, 118, 128, 0.12) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .map-region-btn.active,
html[data-theme="apple"] .map-layer-btn.active {
  background: #007aff !important;
  color: #ffffff !important;
}

/* 13. DPS Formulas & Simulator */
html[data-theme="apple"] .formulas-calc-box,
html[data-theme="apple"] .calc-results-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .calc-slider-header span,
html[data-theme="apple"] .calc-result-label,
html[data-theme="apple"] .calc-result-val {
  color: #1c1c1e !important;
}

/* Monospace formula block */
html[data-theme="apple"] [style*="font-family:monospace"],
html[data-theme="apple"] code,
html[data-theme="apple"] pre {
  background: #f2f2f7 !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* 14. Notes, Dailies & Live Events */
html[data-theme="apple"] .note-card,
html[data-theme="apple"] .checklist-item,
html[data-theme="apple"] .event-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #1c1c1e !important;
}

/* 15. Liquid Glass Modals & Sheets */
html[data-theme="apple"] .mr-modal-backdrop,
html[data-theme="apple"] .modal-overlay,
html[data-theme="apple"] .cb-modal-overlay {
  background: rgba(0, 0, 0, 0.28) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
}

html[data-theme="apple"] .mr-modal-content,
html[data-theme="apple"] .modal-content,
html[data-theme="apple"] .modal-box,
html[data-theme="apple"] .cb-modal-dialog {
  background: rgba(255, 255, 255, 0.95) !important;
  -webkit-backdrop-filter: blur(36px) saturate(190%) !important;
  backdrop-filter: blur(36px) saturate(190%) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .cb-modal-header h2 {
  color: #1c1c1e !important;
}

/* 16. Tooltips & Toasts */
html[data-theme="apple"] .wakayashi-tooltip,
html[data-theme="apple"] .tt {
  background: rgba(255, 255, 255, 0.92) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .toast {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #1c1c1e !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

/* 17. Soulbinding Recommendation Card in Light Mode */
html[data-theme="apple"] .cb-soulbinding-card {
  background: #fdfaff !important;
  border: 1px solid rgba(175, 82, 222, 0.25) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(175, 82, 222, 0.08) !important;
}

html[data-theme="apple"] .cb-soulbinding-card p,
html[data-theme="apple"] .cb-soulbinding-card div,
html[data-theme="apple"] .cb-soulbinding-card strong {
  color: #1c1c1e !important;
}

/* 18. Theme Switcher Segmented Control in Topbar (Both Themes) */
.theme-segmented-control {
  display: inline-flex;
  align-items: center;
  background: rgba(120, 120, 128, 0.24);
  padding: 3px;
  border-radius: 980px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  user-select: none;
  gap: 2px;
  margin-right: 0.5rem;
}

.theme-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 980px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  white-space: nowrap;
  font-family: var(--ui);
  line-height: 1;
}

.theme-seg-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.theme-seg-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  font-weight: 600;
}

/* Light mode overrides for segmented control */
html[data-theme="apple"] .theme-segmented-control {
  background: rgba(118, 118, 128, 0.16) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .theme-seg-btn {
  color: #636366 !important;
}

html[data-theme="apple"] .theme-seg-btn:hover {
  color: #1c1c1e !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .theme-seg-btn.active {
  background: #ffffff !important;
  color: #1c1c1e !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0.5px 1px rgba(0, 0, 0, 0.08) !important;
}

/* Smooth transition when switching themes */
html, body, .rail, .cmd, .card, .panel, .hud, .mr-paperdoll-stage, .mr-slot-box, .cb-modal-dialog, .class-card, .classes-hero-banner {
  transition: background 0.28s cubic-bezier(0.25, 1, 0.5, 1),
              background-color 0.28s cubic-bezier(0.25, 1, 0.5, 1),
              border-color 0.28s cubic-bezier(0.25, 1, 0.5, 1),
              box-shadow 0.28s cubic-bezier(0.25, 1, 0.5, 1),
              color 0.2s ease !important;
}


/* ==========================================================================
   AUTHENTIC CUPERTINO LIGHT MODE: CODEX, BUILDS, ARMORY & PLANNER ENHANCEMENTS
   ========================================================================== */

/* 1. Item Codex & Compact Table in Light Mode */
html[data-theme="apple"] .item-db-container,
html[data-theme="apple"] .item-table-wrapper {
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 12px !important;
}

html[data-theme="apple"] .item-compact-table {
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="apple"] .item-compact-table th {
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.05em !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="apple"] .item-compact-table td {
  color: #1e293b !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .item-compact-table tr:hover td {
  background: rgba(0, 122, 255, 0.04) !important;
}

html[data-theme="apple"] .item-cell-main strong {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .item-cell-main div {
  color: #64748b !important;
}

html[data-theme="apple"] .item-compact-table td div[style*="font-weight:600"] {
  color: #1e293b !important;
}

html[data-theme="apple"] .item-compact-table td div[style*="text-transform:uppercase"] {
  color: #64748b !important;
}

html[data-theme="apple"] .item-compact-table td strong[style*="color:var(--text-muted)"] {
  color: #0f172a !important;
}

html[data-theme="apple"] .item-compact-table td span[style*="color:var(--gold-primary)"] {
  color: #b45309 !important; /* rich, high-contrast amber */
  font-weight: 600 !important;
}

html[data-theme="apple"] .item-compact-table td span[style*="color:var(--blue-arcane)"] {
  color: #0284c7 !important; /* accessible blue */
}

html[data-theme="apple"] .item-compact-table td span[style*="color:var(--text-muted)"] {
  color: #475569 !important;
}

html[data-theme="apple"] .item-action-btn {
  background: #007aff !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 0.35rem 0.75rem !important;
}

html[data-theme="apple"] .item-action-btn:hover {
  background: #0056b3 !important;
}

html[data-theme="apple"] .class-pill--all {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .class-pill--req {
  background: rgba(0, 122, 255, 0.08) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .item-filter-select,
html[data-theme="apple"] #item-search-input {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] #tab-items h2 {
  color: #0f172a !important;
}

/* 2. Community Builds: Role Filter Bar & Pills */
html[data-theme="apple"] .cb-filter-row {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .cb-filter-label {
  color: #0f172a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-chip {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .cb-chip:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .cb-chip.active {
  background: #007aff !important;
  color: #ffffff !important;
  border-color: #007aff !important;
}

html[data-theme="apple"] .cb-views-bar {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cb-view-tab {
  color: #64748b !important;
}

html[data-theme="apple"] .cb-view-tab.active {
  color: #007aff !important;
  border-bottom: 2px solid #007aff !important;
}

html[data-theme="apple"] .cb-class-pill {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1e293b !important;
}

html[data-theme="apple"] .cb-class-pill.active {
  background: #007aff !important;
  border-color: #007aff !important;
  color: #ffffff !important;
}

html[data-theme="apple"] .cb-header-banner {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cb-header-banner h2 {
  color: #0f172a !important;
}

/* 3. Armory & Gear Scorer in Light Mode */
html[data-theme="apple"] .armory-search-bar {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .armory-input-group label {
  color: #334155 !important;
}

html[data-theme="apple"] .armory-select,
html[data-theme="apple"] .armory-input {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-select:focus,
html[data-theme="apple"] .armory-input:focus {
  border-color: #007aff !important;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2) !important;
}

html[data-theme="apple"] .armory-pill {
  background: #f1f5f9 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #475569 !important;
}

html[data-theme="apple"] .armory-pill:hover {
  background: rgba(0, 122, 255, 0.1) !important;
  border-color: #007aff !important;
  color: #007aff !important;
}

html[data-theme="apple"] .armory-hero-card {
  background: #ffffff !important;
  border: 1px solid rgba(132, 102, 234, 0.3) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .armory-char-meta h2 {
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-char-meta div,
html[data-theme="apple"] .armory-char-meta span {
  color: #334155 !important;
}

html[data-theme="apple"] .armory-badge {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .armory-badge.cp {
  background: rgba(0, 122, 255, 0.1) !important;
  border-color: rgba(0, 122, 255, 0.3) !important;
  color: #007aff !important;
}

html[data-theme="apple"] .armory-grade-card {
  background: #f8fafc !important;
  border: 1px solid rgba(132, 102, 234, 0.35) !important;
  box-shadow: 0 4px 14px rgba(132, 102, 234, 0.12) !important;
}

html[data-theme="apple"] .armory-grade-val {
  color: #5856d6 !important;
}

html[data-theme="apple"] .armory-grade-meta-pct {
  color: #5856d6 !important;
}

html[data-theme="apple"] .armory-nav-tabs {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .armory-nav-tab {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-nav-tab.active {
  background: #007aff !important;
  color: #ffffff !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip .face {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip h4 {
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip small {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip .stat-row span {
  color: #334155 !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip .stat-row strong {
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip .bar-track {
  background: #f1f5f9 !important;
}

html[data-theme="apple"] .armory-gear-cards article.flip footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  color: #64748b !important;
}

html[data-theme="apple"] .armory-panel-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-panel-card h3 {
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-reroll-item {
  background: #fef2f2 !important;
  border: 1px solid #fee2e2 !important;
}

html[data-theme="apple"] .armory-reroll-slot {
  color: #dc2626 !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .armory-reroll-target {
  color: #991b1b !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .armory-reroll-advice {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-suggestions-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-suggestion-item {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-suggestion-item:hover {
  background: #f8fafc !important;
}

html[data-theme="apple"] .armory-suggestion-name {
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-suggestion-sub {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-grid-layout h3 {
  color: #0f172a !important;
}

/* 4. Build Planner & Calculator Stage in Light Mode */
html[data-theme="apple"] .mr-paperdoll-wrapper {
  background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .mr-stat-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .mr-item-level-title,
html[data-theme="apple"] .mr-char-level-label {
  color: #0f172a !important;
}

html[data-theme="apple"] .mr-char-title-head {
  color: #0f172a !important;
}

html[data-theme="apple"] .mr-class-card-avatar-wrap {
  background: #f1f5f9 !important;
}

html[data-theme="apple"] .mr-class-card:not(.active) .mr-class-card-img {
  filter: none !important;
  opacity: 0.75 !important;
}

html[data-theme="apple"] .mr-build-action-btn {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="apple"] .mr-build-action-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .hero2 .try-tags,
html[data-theme="apple"] .hero2 .try-tag {
  color: #e2e8f0 !important;
}

html[data-theme="apple"] .item-name-heading {
  color: #0f172a !important;
}
html[data-theme="apple"] .item-type-label {
  color: #334155 !important;
}
html[data-theme="apple"] .cb-filter-divider {
  background: rgba(0, 0, 0, 0.1) !important;
}

/* Safety overrides for inline white text in light mode */
html[data-theme="apple"] [style*="color:#fff"],
html[data-theme="apple"] [style*="color: #fff"],
html[data-theme="apple"] [style*="color:#ffffff"],
html[data-theme="apple"] [style*="color: #ffffff"] {
  color: #0f172a !important;
}

html[data-theme="apple"] .theme-seg-btn.active,
html[data-theme="apple"] .cb-chip.active,
html[data-theme="apple"] .cb-class-pill.active,
html[data-theme="apple"] .item-action-btn,
html[data-theme="apple"] .armory-btn-search,
html[data-theme="apple"] .hero-grid [style*="color:#fff"],
html[data-theme="apple"] .hero2 [style*="color:#fff"] {
  color: #ffffff !important;
}


/* ==========================================================================
   COMPREHENSIVE LIGHT MODE (CUPERTINO LIGHT) ACCESSIBILITY & CONTRAST FIXES
   High Contrast WCAG AA/AAA compliant text, icons, silhouettes, and cards
   ========================================================================== */

/* 1. Base Variables for Maximum Contrast */
html[data-theme="apple"] {
  --bg-primary: #f8fafc !important;
  --bg-secondary: #f1f5f9 !important;
  --bg-card: #ffffff !important;
  --text-main: #0a0e1a !important;
  --text-muted: #1e293b !important;
  --text-dim: #334155 !important;
  --ink: #0a0e1a !important;
  --ink-2: #1e293b !important;
  --muted: #334155 !important;
  --faint: #475569 !important;
  --gold-primary: #b45309 !important; /* Rich amber with 5.5:1 contrast on white */
  --blue-arcane: #0284c7 !important; /* Deep sapphire blue with 5.2:1 contrast */
}

/* 2. Hero HUD & Live Timers (Home View - Dark Galaxy Background Preserved) */
html[data-theme="apple"] .hero2.hud,
html[data-theme="apple"] #hero {
  background: radial-gradient(circle at 70% 30%, rgba(14, 165, 233, 0.18), transparent 70%),
              #080d1a !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="apple"] .hero2 h1,
html[data-theme="apple"] #hero h1 {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
}

html[data-theme="apple"] .hero2 p.lede,
html[data-theme="apple"] #hero p.lede {
  color: #e2e8f0 !important;
}

html[data-theme="apple"] .hero-copy .lbl {
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .suggest span {
  color: #94a3b8 !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .suggest button {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .suggest button:hover {
  background: rgba(0, 122, 255, 0.4) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
}

html[data-theme="apple"] .hero-search {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

html[data-theme="apple"] .hero-search input {
  color: #ffffff !important;
}

html[data-theme="apple"] .hero-search input::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="apple"] #countdown,
html[data-theme="apple"] .countdown {
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

html[data-theme="apple"] #countdown h3,
html[data-theme="apple"] .countdown h3,
html[data-theme="apple"] #countdown span,
html[data-theme="apple"] .countdown span {
  color: #ffffff !important;
}

html[data-theme="apple"] .timer-box,
html[data-theme="apple"] .cd-num {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* 3. 4 Feature Modules on Home (Codex, Skills, World, Sources) */
html[data-theme="apple"] .modules .module {
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .modules .module b {
  color: #ffffff !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
}

html[data-theme="apple"] .modules .module small {
  color: #e2e8f0 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85) !important;
}

html[data-theme="apple"] .modules .module .ic {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* 4. Navigation Rail Icons & Labels */
html[data-theme="apple"] .rail-btn {
  color: #1e293b !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .rail-btn .nav-ic,
html[data-theme="apple"] .rail-btn svg {
  stroke: #1e293b !important;
  stroke-width: 2 !important;
  opacity: 0.9 !important;
}

html[data-theme="apple"] .rail-btn:hover {
  background: rgba(0, 122, 255, 0.08) !important;
  color: #007aff !important;
}

html[data-theme="apple"] .rail-btn:hover .nav-ic,
html[data-theme="apple"] .rail-btn:hover svg {
  stroke: #007aff !important;
  opacity: 1 !important;
}

html[data-theme="apple"] .rail-btn.active {
  background: rgba(0, 122, 255, 0.12) !important;
  color: #007aff !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .rail-btn.active .nav-ic,
html[data-theme="apple"] .rail-btn.active svg {
  stroke: #007aff !important;
  stroke-width: 2.2 !important;
  opacity: 1 !important;
}

/* 5. Community Builds: Role & Tags Filter Bar */
html[data-theme="apple"] .cb-filter-row {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .cb-filter-label {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-chip {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .cb-chip:hover {
  background: rgba(0, 122, 255, 0.08) !important;
  color: #007aff !important;
  border-color: rgba(0, 122, 255, 0.3) !important;
}

html[data-theme="apple"] .cb-chip.active {
  background: #007aff !important;
  color: #ffffff !important;
  border-color: #007aff !important;
}

html[data-theme="apple"] .cb-filter-divider {
  background: rgba(0, 0, 0, 0.1) !important;
}

/* 6. Codex Items Database Table */
html[data-theme="apple"] .item-table-wrapper {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .item-compact-table {
  background: #ffffff !important;
  color: #1e293b !important;
}

html[data-theme="apple"] .item-compact-table th {
  background: #f8fafc !important;
  color: #0a0e1a !important;
  font-weight: 800 !important;
  font-size: 0.8rem !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .item-compact-table td {
  color: #1e293b !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .item-name-heading {
  color: #0a0e1a !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .item-type-label {
  color: #0a0e1a !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .item-compact-table td div[style*="text-transform:uppercase"] {
  color: #334155 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .class-pill--all {
  color: #334155 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .class-pill--req {
  color: #92400e !important;
  background: #fef3c7 !important;
  border: 1px solid #fde68a !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .item-rarity-pill.special,
html[data-theme="apple"] .item-rarity-pill.ancient {
  color: #0e7490 !important;
  background: #cffafe !important;
  border: 1px solid #a5f3fc !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-rarity-pill.mythic,
html[data-theme="apple"] .item-rarity-pill.epic {
  color: #9f1239 !important;
  background: #ffe4e6 !important;
  border: 1px solid #fecdd3 !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-rarity-pill.eternal,
html[data-theme="apple"] .item-rarity-pill.unique {
  color: #c2410c !important;
  background: #ffedd5 !important;
  border: 1px solid #fed7aa !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-rarity-pill.fabled {
  color: #854d0e !important;
  background: #fef9c3 !important;
  border: 1px solid #fef08a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-rarity-pill.heroic,
html[data-theme="apple"] .item-rarity-pill.legend {
  color: #0369a1 !important;
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-rarity-pill.superior,
html[data-theme="apple"] .item-rarity-pill.rare {
  color: #166534 !important;
  background: #dcfce7 !important;
  border: 1px solid #bbf7d0 !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-rarity-pill.common {
  color: #475569 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .item-compact-table td span[style*="var(--gold-primary)"] {
  color: #b45309 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .item-compact-table td span[style*="var(--blue-arcane)"] {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .item-action-btn {
  background: rgba(0, 122, 255, 0.08) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .item-action-btn:hover {
  background: #007aff !important;
  color: #ffffff !important;
}

/* 7. Armory & Character Scoring */
html[data-theme="apple"] .armory-search-bar {
  position: relative !important;
  z-index: 500 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-search-wrapper {
  position: relative !important;
  z-index: 600 !important;
}

html[data-theme="apple"] .armory-select,
html[data-theme="apple"] .armory-input {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-suggestions-box,
html[data-theme="apple"] #armory-suggestions-box {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 999999 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="apple"] .armory-suggestion-item {
  color: #0a0e1a !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .armory-suggestion-item:hover {
  background: #f1f5f9 !important;
}

html[data-theme="apple"] .armory-hero-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .armory-char-meta h2 span {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .armory-badge {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .armory-badge.cp {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .armory-gear-cards article.card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-gear-cards article.card.s,
html[data-theme="apple"] .armory-gear-cards article.card.splus {
  border-color: #f59e0b !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12) !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .line span {
  color: #1e293b !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .line.zero span {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* Gear & Relic Cards Light Theme Polish */
html[data-theme="apple"] .armory-gear-cards article.card.splus .inner,
html[data-theme="apple"] .armory-gear-cards article.card.bis .inner,
html[data-theme="apple"] .armory-gear-cards article.card.s .inner,
html[data-theme="apple"] .armory-gear-cards article.card.a .inner,
html[data-theme="apple"] .armory-gear-cards article.card.b .inner,
html[data-theme="apple"] .armory-gear-cards article.card .inner {
  background: #ffffff !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .face {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .card-meta b {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .card-meta .note {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .card-meta .facet {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .card-meta .facet small {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .enchant {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .turn {
  color: #64748b !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .turn span {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .line span {
  color: #1e293b !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .line.zero span {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

html[data-theme="apple"] .armory-gear-cards article.card .line .bar {
  background: #e2e8f0 !important;
}


html[data-theme="apple"] .armory-panel-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-panel-card h3 {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .armory-reroll-item {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-radius: 8px !important;
  padding: 0.6rem 0.8rem !important;
}

html[data-theme="apple"] .armory-reroll-slot {
  color: #b91c1c !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .armory-reroll-target {
  color: #991b1b !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .armory-reroll-desc {
  color: #7f1d1d !important;
  font-size: 0.8rem !important;
}

/* 8. Build Planner: Slot Silhouettes & Character Doll Container */
html[data-theme="apple"] .mr-slot-box:not(.has-item) {
  background: #ffffff !important;
  border: 1.5px solid rgba(0, 0, 0, 0.16) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .mr-slot-box:not(.has-item):hover {
  border-color: #007aff !important;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .mr-slot-box:not(.has-item) img {
  filter: brightness(0.12) contrast(1.8) !important;
  opacity: 0.9 !important;
}

html[data-theme="apple"] .mr-slot-label,
html[data-theme="apple"] .mr-slot-short {
  color: #0a0e1a !important;
  font-weight: 700 !important;
}

/* 9. Skills & Classes View Clarity */
html[data-theme="apple"] .classes-hero-banner {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .classes-hero-banner h2 {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .classes-hero-banner p {
  color: #334155 !important;
}

html[data-theme="apple"] .class-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .class-name {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .class-role {
  color: #007aff !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .class-desc {
  color: #1e293b !important;
}

html[data-theme="apple"] .class-filter-pill,
html[data-theme="apple"] .class-tag-pill {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .class-filter-pill.active,
html[data-theme="apple"] .class-tag-pill.active {
  background: #007aff !important;
  color: #ffffff !important;
  border-color: #007aff !important;
}

html[data-theme="apple"] .pro-con-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

html[data-theme="apple"] .pro-con-box ul li {
  color: #1e293b !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
}

html[data-theme="apple"] .cg-detail-text p {
  color: #1e293b !important;
  line-height: 1.6 !important;
}

html[data-theme="apple"] .cg-specs li {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1e293b !important;
}

html[data-theme="apple"] .cg-specs li.is-pick {
  background: rgba(0, 122, 255, 0.08) !important;
  border-color: #007aff !important;
}

html[data-theme="apple"] .cg-spec-text {
  color: #0a0e1a !important;
  font-weight: 600 !important;
}


/* ==========================================================================
   COMMUNITY BUILDS MODAL & DETAILS (CUPERTINO LIGHT)
   High contrast, crisp typography, clean cards for Light Mode
   ========================================================================== */
html[data-theme="apple"] .cb-modal-dialog {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18) !important;
  color: #0a0e1a !important;
}

html[data-theme="apple"] .cb-modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cb-modal-header h2 {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .mr-modal-close-btn {
  color: #1e293b !important;
}

html[data-theme="apple"] .mr-modal-close-btn:hover {
  color: #000000 !important;
}

html[data-theme="apple"] .cb-modal-action-bar {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .cb-modal-views {
  color: #475569 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .cb-modal-section {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

html[data-theme="apple"] .cb-modal-desc h4 {
  color: #b45309 !important; /* rich amber */
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-modal-desc p {
  color: #0a0e1a !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
}

html[data-theme="apple"] .cb-soulbinding-card {
  background: #fdf4ff !important;
  border: 1.5px solid rgba(192, 132, 252, 0.4) !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.08) !important;
}

html[data-theme="apple"] .cb-sb-header h4 {
  color: #6b21a8 !important; /* deep rich purple */
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-sb-rarity-badge {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border: 1px solid #d8b4fe !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .cb-sb-overview {
  color: #0a0e1a !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
}

html[data-theme="apple"] .cb-sb-priorities-title {
  color: #6b21a8 !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-sb-prio-pill {
  background: #f3e8ff !important;
  color: #581c87 !important;
  border: 1px solid #c084fc !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .cb-sb-slots-grid {
  gap: 0.75rem !important;
}

html[data-theme="apple"] .cb-sb-slot-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .cb-sb-slot-header strong {
  color: #0a0e1a !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .cb-sb-slot-prio {
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .cb-sb-slot-prio.is-bis {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .cb-sb-stat-pill {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .cb-sb-tip-box {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
}

html[data-theme="apple"] .cb-sb-tip-content {
  color: #78350f !important;
}

html[data-theme="apple"] .cb-sb-tip-content strong {
  color: #92400e !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-modal-guide h4 {
  color: #0284c7 !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-modal-guide-text {
  color: #0a0e1a !important;
  font-weight: 500 !important;
}

html[data-theme="apple"] .cb-modal-video h4 {
  color: #e11d48 !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-video-link {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

html[data-theme="apple"] .cb-modal-comments h4 {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .cb-comment-item {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .cb-comment-header strong {
  color: #007aff !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .cb-comment-text {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .cb-comment-form input {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #0a0e1a !important;
}

html[data-theme="apple"] .cb-modal-dialog label {
  color: #0a0e1a !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .cb-modal-dialog input,
html[data-theme="apple"] .cb-modal-dialog select,
html[data-theme="apple"] .cb-modal-dialog textarea {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #0a0e1a !important;
}


/* ==========================================================================
   AUTHENTIC CUPERTINO LIGHT MODE: ARMORY SUBTABS, SKILLS & ARCANA
   ========================================================================== */
html[data-theme="apple"] .armory-subnav {
  border-bottom: 2px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .armory-subtab-btn {
  color: #475569 !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .armory-subtab-btn:hover {
  color: #0a0e1a !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .armory-subtab-btn.active {
  color: #007aff !important;
  border-bottom-color: #007aff !important;
  background: rgba(0, 122, 255, 0.06) !important;
}

/* Skills View Light (Compact with Hover Tooltip) */
html[data-theme="apple"] .armory-skills-hero {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-skills-hero-meta h3 {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-skills-count {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
}

html[data-theme="apple"] .armory-skills-hero-meta p {
  color: #334155 !important;
}

html[data-theme="apple"] .armory-skills-section-title {
  color: #0a0e1a !important;
  font-weight: 800 !important;
}

html[data-theme="apple"] .armory-skill-tile {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-skill-tile:hover {
  border-color: #007aff !important;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.12) !important;
}

html[data-theme="apple"] .armory-skill-tile.is-stigma {
  background: #fdf4ff !important;
  border: 1px solid rgba(192, 132, 252, 0.4) !important;
}

html[data-theme="apple"] .armory-skill-name-txt {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-skill-cd-txt {
  color: #0284c7 !important;
}

html[data-theme="apple"] .armory-stigma-badge {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border: 1px solid #d8b4fe !important;
}

html[data-theme="apple"] .armory-skill-subtag.is-active {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

html[data-theme="apple"] .armory-skill-subtag.is-rank {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

html[data-theme="apple"] .armory-skill-subtag.is-weapon {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="apple"] .armory-skill-subtag.is-stigma-tag {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border: 1px solid #d8b4fe !important;
}

html[data-theme="apple"] .armory-skill-tile.is-passive {
  background: #f0fdf4 !important;
  border: 1px solid rgba(52, 211, 153, 0.4) !important;
}

html[data-theme="apple"] .armory-skill-lvl-badge.is-passive {
  background: #059669 !important;
  color: #ffffff !important;
}

html[data-theme="apple"] .armory-passive-badge {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

html[data-theme="apple"] .armory-skill-subtag.is-passive-tag {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}

/* Classes Tab Stigma & Passive Cards Light Mode */
html[data-theme="apple"] .cg-stigma-card {
  background: #fdf4ff !important;
  border: 1px solid rgba(192, 132, 252, 0.4) !important;
}

html[data-theme="apple"] .cg-stigma-title {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .cg-stigma-desc {
  color: #334155 !important;
}

html[data-theme="apple"] .cg-passive-card {
  background: #f0fdf4 !important;
  border: 1px solid rgba(52, 211, 153, 0.4) !important;
}

html[data-theme="apple"] .cg-passive-title {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .cg-passive-desc {
  color: #334155 !important;
}



/* Rich Hover Tooltip Light */
html[data-theme="apple"] .armory-skill-hover-tooltip {
  background: #ffffff !important;
  border: 1px solid rgba(0, 122, 255, 0.35) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 0 10px rgba(0, 122, 255, 0.08) !important;
}

html[data-theme="apple"] .armory-tooltip-header strong {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-tooltip-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .armory-tooltip-cd {
  color: #0284c7 !important;
}

html[data-theme="apple"] .armory-tooltip-sub {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-tooltip-desc {
  color: #334155 !important;
}

/* Authentic Arcana View Light */
html[data-theme="apple"] .armory-arcana-hero {
  background: #fdf4ff !important;
  border: 1.5px solid rgba(192, 132, 252, 0.4) !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.06) !important;
}

html[data-theme="apple"] .armory-arcana-hero h3 {
  color: #6b21a8 !important;
}

html[data-theme="apple"] .armory-arcana-hero p {
  color: #334155 !important;
}

html[data-theme="apple"] .armory-arcana-badge-deck {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border: 1px solid #d8b4fe !important;
}

html[data-theme="apple"] .armory-arcana-summary-panel {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .armory-arcana-summary-panel h4 {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-arcana-skill-boost-item {
  background: #fdf4ff !important;
  border: 1px solid rgba(192, 132, 252, 0.35) !important;
}

html[data-theme="apple"] .armory-arcana-skill-boost-item .sk-name {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-arcana-skill-boost-item .sk-badge {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border: 1px solid #d8b4fe !important;
}

/* Armory Search Results Table Light */
html[data-theme="apple"] .armory-results-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .armory-results-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .armory-results-header h3 {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-results-count {
  color: #64748b !important;
}

html[data-theme="apple"] .armory-results-table th {
  background: #f8fafc !important;
  color: #0a0e1a !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .armory-results-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .armory-results-row:hover td {
  background: rgba(0, 122, 255, 0.04) !important;
}

html[data-theme="apple"] .armory-char-name-bold {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .armory-action-inspect-btn {
  background: rgba(0, 122, 255, 0.1) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .armory-action-inspect-btn:hover {
  background: #007aff !important;
  color: #ffffff !important;
}


/* Attached Community Build Info Panel Light Mode */
html[data-theme="apple"] .mr-attached-build-panel {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="apple"] .mr-attached-build-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="apple"] .mr-attached-badge {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

html[data-theme="apple"] .mr-attached-creator {
  color: #475569 !important;
}

html[data-theme="apple"] .mr-attached-creator strong {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .mr-attached-title {
  color: #0a0e1a !important;
}

/* Light mode adjustments for Armory Refresh Button */
html[data-theme="apple"] .armory-refresh-btn {
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  color: #0284c7 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="apple"] .armory-refresh-btn:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.16) !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.18) !important;
}

html[data-theme="apple"] .armory-refresh-btn.cooldown {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}

html[data-theme="apple"] .armory-sync-status-row {
  color: #64748b !important;
}

/* ==========================================================================
   Light Mode (Apple Theme) - Market Overview & Exchange Dashboard
   ========================================================================== */
html[data-theme="apple"] .market-page-head,
html[data-theme="apple"] .market-metric-card,
html[data-theme="apple"] .market-movers-panel,
html[data-theme="apple"] .market-explorer-section,
html[data-theme="apple"] .market-loading-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="apple"] .market-head-h1,
html[data-theme="apple"] .market-panel-title,
html[data-theme="apple"] .market-metric-val,
html[data-theme="apple"] .market-modal-title,
html[data-theme="apple"] .market-modal-stat-val,
html[data-theme="apple"] .market-cell-name {
  color: #0a0e1a !important;
}

html[data-theme="apple"] .market-head-sub,
html[data-theme="apple"] .market-panel-sub,
html[data-theme="apple"] .market-metric-lbl,
html[data-theme="apple"] .market-modal-sub,
html[data-theme="apple"] .market-modal-stat-lbl,
html[data-theme="apple"] .market-table th,
html[data-theme="apple"] .market-tax-fee,
html[data-theme="apple"] .market-listings-pill,
html[data-theme="apple"] .market-cell-sub {
  color: #64748b !important;
}

html[data-theme="apple"] .market-select {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="apple"] .market-select:hover,
html[data-theme="apple"] .market-select:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.2) !important;
}

html[data-theme="apple"] .market-refresh-btn {
  background: rgba(2, 132, 199, 0.08) !important;
  border: 1px solid rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
}

html[data-theme="apple"] .market-refresh-btn:hover {
  background: rgba(2, 132, 199, 0.16) !important;
  color: #0369a1 !important;
}

html[data-theme="apple"] .market-metric-card.quna-highlight {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #ffffff 100%) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

html[data-theme="apple"] .market-panel-head {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .market-mover-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="apple"] .market-mover-card:hover {
  border-color: #0284c7 !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1) !important;
}

html[data-theme="apple"] .market-mover-icon-wrap {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="apple"] .market-mover-title {
  color: #0f172a !important;
}

html[data-theme="apple"] .market-price-new,
html[data-theme="apple"] .market-cell-price strong {
  color: #0f172a !important;
}

html[data-theme="apple"] .market-price-old {
  color: #94a3b8 !important;
}

html[data-theme="apple"] .market-cat-chip {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

html[data-theme="apple"] .market-cat-chip:hover {
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

html[data-theme="apple"] .market-cat-chip.active {
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

html[data-theme="apple"] .market-search-box {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="apple"] .market-search-box input {
  color: #0f172a !important;
}

html[data-theme="apple"] .market-table th {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="apple"] .market-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="apple"] .market-table-row:hover {
  background: rgba(2, 132, 199, 0.05) !important;
}

html[data-theme="apple"] .market-cat-badge {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #475569 !important;
}

html[data-theme="apple"] .market-stock-pill {
  color: #334155 !important;
}

html[data-theme="apple"] .market-inspect-btn {
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
}

html[data-theme="apple"] .market-inspect-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

html[data-theme="apple"] .market-modal-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16) !important;
}

html[data-theme="apple"] .market-modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="apple"] .market-modal-close {
  color: #64748b !important;
}

html[data-theme="apple"] .market-modal-close:hover {
  color: #0f172a !important;
}

html[data-theme="apple"] .market-modal-stat-box,
html[data-theme="apple"] .market-tax-panel {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="apple"] .market-tax-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="apple"] .market-tax-type {
  color: #0284c7 !important;
}

html[data-theme="apple"] .market-tax-card.world .market-tax-type {
  color: #d97706 !important;
}

html[data-theme="apple"] .market-tax-payout {
  color: #0f172a !important;
}

html[data-theme="apple"] .market-advice-box {
  background: rgba(2, 132, 199, 0.08) !important;
  border-left: 3px solid #0284c7 !important;
  color: #0369a1 !important;
}
