/* DD-q47 · owner D. Loaded last in the host, hub shadow tree and mission/map frames. */
body :is(.app-topbar, .manager-topbar, .app-sidebar, .mobile-bottomnav),
body :is(.mia-float-btn, .mia-dock-btn),
body .hub-mia-panel--hub .mia-toggle,
body .mobile-bottomnav .mobile-bottomnav-mia-img {
  background: var(--glass-plain) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  backdrop-filter: var(--glass-blur) !important;
  border: 0 !important;
  box-shadow: var(--glass-shadow), var(--glass-highlight) !important;
}
/* The rail's children must let its single glass surface show through. */
body .app-sidebar .sidebar-item { background: transparent; }
body :is(.sidebar-item, .mobile-bottomnav-item).active { color: var(--accent) !important; background: var(--control-tinted-fill) !important; }
body .sidebar-bottom:empty { display: none; padding: 0; margin: 0; min-height: 0; }
body .app-topbar { position: sticky !important; top: 0; z-index: 45; }
body .manager-topbar { position: fixed; }
body .app-sidebar { position: sticky; top: 0; }
body .mobile-bottomnav { position: fixed; bottom: 0; }
/* Scroll the learner content behind its retained grid header, with initial clearance. */
.learner-frame[data-learner-page] > .app-shell > .app-content,
body.learner-mission-page > .app-shell > .app-content {
  grid-row: 1 / -1;
  padding-top: var(--topbar-h, 52px);
}
@media (max-width: 900px) {
  .learner-frame[data-learner-page] > .app-shell > .app-content,
  body.learner-mission-page > .app-shell > .app-content { padding-top: calc(52px + env(safe-area-inset-top, 0px)); }
}
body.q-career-radar .mia-float-btn { background: var(--glass-image) !important; }
body :is(.mia-float-btn, .mia-dock-btn) { overflow: visible; border-radius: 50%; }
/* Legacy unread spans retain their IDs for the existing read/unread controller. */
body :is(.mia-unread-badge, .mia-dock-badge, .mobile-bottomnav-mia-badge) { display: none !important; }
body :is(.mia-float-btn, .mia-dock-btn, .mobile-bottomnav-mia, .hub-mia-panel--hub .mia-toggle)::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  border: 2px solid var(--accent);
}
body :is(.mia-float-btn, .mia-dock-btn, .mobile-bottomnav-mia, .hub-mia-panel--hub .mia-toggle)[data-mia-tip="true"]::after {
  opacity: .18;
  animation: mia-tip-halo 2.4s ease-in-out 3;
}
body .mobile-bottomnav .mobile-bottomnav-mia::after {
  inset: auto;
  width: 32px; height: 32px; top: 0; left: calc(50% - 18px);
}
@keyframes mia-tip-halo {
  0%, 100% { opacity: .18; transform: scale(1); box-shadow: 0 0 4px var(--accent); }
  50% { opacity: .4; transform: scale(1.08); box-shadow: 0 0 16px var(--accent); }
}
/* Screenshot-only alternative. No markup or animation is added in the shipped default. */
body [data-mia-cue="chip"][data-mia-tip="true"]::before {
  content: '1 conseil'; display: block !important; position: absolute; left: auto; right: calc(100% + 8px); top: 12px; bottom: auto;
  width: max-content; height: auto; padding: 7px 12px; border-radius: 30px;
  background: var(--glass-plain); color: var(--text-main);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow); pointer-events: none;
  animation: mia-tip-chip 4s ease both;
}
@keyframes mia-tip-chip {
  0%, 100% { opacity: 0; transform: translateX(12px); }
  12%, 88% { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  body :is(.mia-float-btn, .mia-dock-btn, .mobile-bottomnav-mia, .hub-mia-panel--hub .mia-toggle)[data-mia-tip="true"]::after { animation: none; opacity: .18; transform: none; }
  body [data-mia-cue="chip"][data-mia-tip="true"]::before { content: none; animation: none; }
}

/* One mission surface, on desktop and in the phone sheet. */
body :is(.mission-window, .detail-sheet) {
  background: var(--glass-plain) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 0 !important; box-shadow: var(--glass-shadow) !important;
  color: var(--text-main); border-radius: 24px;
}
/* Slightly deepen dark glass so muted facts stay AA over the brightest map areas. */
:root:is([data-mode="dark"], [data-theme="dark"]) body :is(.mission-window, .detail-sheet) {
  background: color-mix(in srgb, var(--glass-plain) 75%, var(--bg-panel)) !important;
}
body .mission-window { width: min(480px, calc(100vw - 32px)); }
body :is(.mission-window-header, .detail-sheet-inner) { background: transparent !important; border: 0; }
body .mission-window-header { padding: 24px 64px 8px 28px; }
body :is(.mission-window-close, .detail-sheet-close) {
  position: absolute; top: 12px; right: 12px;
  width: 44px !important; height: 44px !important;
  border: 0 !important; border-radius: 50%; background: transparent !important;
  color: var(--text-main) !important; z-index: 2;
}
body :is(.mission-window-close, .detail-sheet-close) svg { width: 16px; height: 16px; }
body .mission-window-body { padding: 8px 28px 28px; gap: 20px; }
body .detail-sheet-inner { padding: 56px 24px 24px; }
body :is(.node-info-block, .node-progress-block, .node-detail-dl, .node-locked-block, .node-locked-section, .career-badge-detail,
  .sheet-info-block, .sheet-progress-block, .sheet-locked-block, .sheet-locked-section) {
  border: 0; background: transparent; box-shadow: none; padding: 0;
}
body :is(.node-detail-title, .sheet-title) { font-family: var(--font-heading, var(--font-display)); font-size: 26px; line-height: 1.2; margin: 8px 0 14px; color: var(--text-main) !important; }
/* The shared row prevents flex-column stretching and keeps all metadata together. */
body .mission-chips {
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap;
  gap: 6px; padding: 0; margin: 0; border: 0;
}
body .mission-chips > :is(.node-status-badge, .sheet-status-badge, .node-level-badge, .sheet-level-badge, .node-detail-family, .sheet-family) {
  display: inline-flex; align-items: center; flex: 0 0 auto; width: auto; max-width: 100%;
  min-height: 24px; box-sizing: border-box; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: normal;
  text-transform: none; margin: 0; overflow-wrap: anywhere;
}
body .mission-chips > :is(.node-detail-family, .sheet-family, .node-level-badge, .sheet-level-badge) {
  border: 0; background: var(--control-tinted-fill); color: var(--text-main) !important;
}
body :is(.node-mia-note, .node-detail-competence, .sheet-competence) { display: none; }
body :is(.node-progress-bar-track, .sheet-progress-track) { height: 5px; background: var(--border-soft); border-radius: 20px; margin: 8px 0 20px; }
body :is(.node-progress-bar-fill, .sheet-progress-fill) { height: 100%; background: var(--accent); border-radius: inherit; }
body .node-detail-dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px 16px; margin: 0; }
body .node-detail-dl :is(dt, dd) { margin: 0; padding: 0; border: 0; background: transparent; }
body .node-detail-dl dt { color: var(--text-muted); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: normal; line-height: 1.5; }
body .node-detail-dl dd { color: var(--text-main); font-size: 14px; font-weight: 600; text-align: right; line-height: 1.5; overflow-wrap: anywhere; }
body .career-badge-detail { display: flex; gap: 18px; align-items: center; margin: 20px 0; }
body .career-badge-detail[hidden] { display: none; }
body .career-badge-object { position: relative; flex: 0 0 84px; width: 84px; height: 84px; }
body .career-badge-object::before { content: ''; position: absolute; inset: 3px -6px -3px 6px; border-radius: 50%; background: var(--badge-back-gold-surface); box-shadow: var(--badge-back-gold-bevel); }
body .career-badge-artwork { position: relative; width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 3px 4px #0003); }
body .career-badge-copy p { margin: 4px 0; }
body .career-badge-label { color: var(--text-main); font-weight: 700; }
body :is(.career-badge-status, .career-badge-description) { color: var(--text-muted); font-size: 12px; }
/* Outrank the copied light-mode white panel and keep the icon with its sentence. */
html body :is(.node-locked-block, .sheet-locked-block) {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  padding: 13px; border-radius: 14px; background: var(--control-tinted-fill) !important;
  color: var(--text-main); border: 0; box-shadow: none;
}
body :is(.node-locked-icon, .sheet-locked-icon) { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; color: var(--text-main); }
html body :is(.node-locked-reason, .sheet-locked-reason) { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-main) !important; }
body #detail-sheet-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
body .detail-sheet { max-height: calc(100dvh - 16px); overflow: hidden; }
body .detail-sheet-inner { min-height: 0; overscroll-behavior: contain; }
body :is(.mission-window-body, #detail-sheet-content) > * { flex-shrink: 0; min-width: 0; }
body .career-badge-copy { min-width: 0; overflow-wrap: anywhere; }
body :is(.course-link, .sheet-course-link) {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
  border: 0; border-radius: 30px; background: var(--capsule-primary-fill); color: var(--capsule-primary-ink);
  text-decoration: none; font-weight: 700; margin-top: 20px;
}
body :is(.course-link, .sheet-course-link):hover { background: var(--capsule-primary-hover); color: var(--capsule-primary-ink); }

/* DD-q47 · owner D: the dashboard guide uses the same desktop bubble as the hub. */
@media(min-width:1024px) {
  .learner-frame[data-learner-page="dashboard"] #slot-mia .hub-mia-panel--hub {
    position:fixed; right:24px; bottom:24px; z-index:250; width:64px; height:64px; margin:0;
  }
  .learner-frame[data-learner-page="dashboard"] #slot-mia .mia-toggle {
    display:flex; position:relative; width:64px; height:64px; min-height:0; padding:0;
    border-radius:50%; align-items:center; justify-content:center; cursor:pointer;
  }
  .learner-frame[data-learner-page="dashboard"] #slot-mia .mia-toggle-portrait {
    width:60px; height:60px; object-fit:cover; border-radius:50%;
  }
  .learner-frame[data-learner-page="dashboard"] #slot-mia .mia-toggle-text { display:none; }
  .learner-frame[data-learner-page="dashboard"] #slot-mia .mia-panel-full { display:none; }
  .learner-frame[data-learner-page="dashboard"] #slot-mia [data-mia-open="true"] .mia-panel-full {
    display:grid; position:absolute; right:0; bottom:80px; width:320px; max-height:70vh; overflow:auto;
    padding:24px; border:0; border-radius:24px; color:var(--text-main); background:var(--glass-plain);
    backdrop-filter:var(--glass-blur); -webkit-backdrop-filter:var(--glass-blur); box-shadow:var(--glass-shadow);
  }
  .learner-frame[data-learner-page="dashboard"] #slot-mia .mia-float-close { top:8px; right:8px; width:44px; height:44px; border:0; }
}
/* In the hosted phone frame the persistent Mia tab opens this retained controller. */
@media (max-width: 900px) {
  body.q-career-radar[data-host-header] #mia-float-btn { display: none !important; }
}

/* Hide mission unread dots without changing the byte-pinned vendor stylesheet. */
.mia-unread-badge, .mia-dock-badge { display:none !important; animation:none !important; }
