/* Compatibility entrypoint during Phase 6 cleanup. */
@import url("../themes/memory.css?v=theme-memory-20260711-2");

/* Fragment actions are plain text; detail taxonomies share one uninterrupted
   form surface instead of stacking rectangular containers around chip rows. */
.memory-palace-v3 .memory-entry-actions {
  gap: 18px !important;
}

.memory-palace-v3 .memory-entry-actions button,
.memory-palace-v3 .memory-entry.fragment-item .memory-entry-actions button,
.memory-palace-v3 .memory-entry.fragment-item .memory-entry-actions button:first-child {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 2px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

.memory-detail-backdrop .memory-detail-block,
.memory-detail-backdrop .memory-chip-grid,
.memory-detail-backdrop .memory-room-choice-grid,
.memory-detail-backdrop .memory-stars {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.memory-detail-backdrop .memory-chip-grid,
.memory-detail-backdrop .memory-room-choice-grid,
.memory-detail-backdrop .memory-stars {
  padding: 0 !important;
}

.memory-detail-backdrop .memory-detail-actions .ghost {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 4px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Phase 11 — Thought Pool, Dream Fragments and Lingering Gaze once carried
   their own Night palette.  Remap their local variables to the global theme
   contract so expanded cards are as safe as their overview screens. */
.memory-palace-v3.thought-pool-shell {
  --tp-bg: var(--color-page);
  --tp-surface: var(--color-surface);
  --tp-surface-strong: var(--color-panel-solid);
  --tp-ink: var(--color-text);
  --tp-muted: var(--color-text-muted);
  --tp-dim: var(--color-text-dim);
  --tp-pink: var(--color-ornament);
  --tp-hot: var(--color-accent-strong);
  --tp-violet: var(--color-accent);
  --tp-line: var(--color-border);
  --tp-line-soft: var(--color-border);
  background: var(--color-page) !important;
  color: var(--color-text) !important;
}

.memory-palace-v3.thought-pool-shell .memory-control-head {
  border-color: var(--color-border) !important;
  background: var(--color-chrome) !important;
}

.memory-palace-v3.thought-pool-shell :is(.thought-echo, .thought-seed, .thought-echo-detail section) {
  border-color: var(--color-border) !important;
  background: transparent !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

.memory-palace-v3.thought-pool-shell :is(.thought-echo-detail p, .thought-echo-detail small, .thought-echo-source, .thought-echo-source a) {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3.thought-pool-shell :is(.thought-echo-status, .thought-echo-source a, .thought-pool-filters button.active) {
  color: var(--color-ornament) !important;
  -webkit-text-fill-color: var(--color-ornament) !important;
}

.memory-palace-v3.dream-fragments-shell {
  --df-bg: var(--color-page);
  --df-surface: var(--color-surface);
  --df-surface-soft: var(--color-surface-raised);
  --df-ink: var(--color-text);
  --df-muted: var(--color-text-muted);
  --df-dim: var(--color-text-dim);
  --df-line: var(--color-border);
  --df-line-strong: var(--color-border-strong);
  --df-pink: var(--color-ornament);
  --df-violet: var(--color-accent);
  background: var(--color-page) !important;
  color: var(--color-text) !important;
}

.memory-palace-v3.dream-fragments-shell .dream-fragments-materials article {
  border-color: var(--color-border) !important;
  background: var(--color-surface-raised) !important;
}

.memory-palace-v3.dream-fragments-shell .dream-fragments-materials :is(span, small) {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3.dream-fragments-shell .dream-fragments-materials b {
  color: var(--color-ornament) !important;
  -webkit-text-fill-color: var(--color-ornament) !important;
}

.memory-palace-v3.dream-fragments-shell :is(.dream-wisp-detail, .dream-wisp-detail section, .dream-wisp-remained, .dream-wisp-lingers) {
  border-color: var(--color-border) !important;
  background: transparent !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

.memory-palace-v3.dream-fragments-shell :is(.dream-wisp-detail p, .dream-wisp-detail small, .dream-wisp-sources blockquote, .dream-wisp-sources a) {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3.dream-fragments-shell :is(.dream-fragments-filters button.active, .dream-wisp-actions button.active) {
  border-color: var(--color-border-strong) !important;
  background: var(--color-accent-soft) !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage,
.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode,
.memory-palace-v3.interest-drawer-shell .interest-drawer-cloud {
  border-color: var(--color-border) !important;
  background: var(--color-surface-raised) !important;
  color: var(--color-text) !important;
  box-shadow: none !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode .interest-drawer-cloud {
  min-height: var(--interest-cloud-stage-min-height) !important;
  border-radius: inherit !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-cloud-field {
  min-height: max(520px, calc(var(--interest-cloud-stage-min-height) - 124px)) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet-backdrop {
  background: var(--color-overlay) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet {
  border-color: var(--color-border-strong) !important;
  background: var(--color-panel-solid) !important;
  color: var(--color-text) !important;
  box-shadow: var(--shadow-modal) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet :is(
  h2, h3, strong, b, .interest-drawer-detail-copy
) {
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet :is(
  p, small, span, em, .interest-drawer-status-rows
) {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet :is(section, article, .interest-drawer-status-rows > div) {
  border-color: var(--color-border) !important;
  background: var(--color-surface) !important;
  box-shadow: none !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-detail-close {
  border-color: var(--color-border) !important;
  background: transparent !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

/* Phase 12 — expanded memory experiences use semantic roles end to end. */
.memory-palace-v3.thought-pool-shell .thought-echo-detail :is(
  .thought-status-control p, .thought-pool-lifecycle li,
  .thought-source-trail span, .thought-source-trail em, footer span
) {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3.thought-pool-shell .thought-echo-detail :is(small, .thought-echo-status) {
  color: var(--color-ornament) !important;
  -webkit-text-fill-color: var(--color-ornament) !important;
  opacity: 1 !important;
}

.memory-palace-v3.thought-pool-shell .thought-echo-detail :is(button, .thought-source-trail span) {
  border-color: var(--color-border) !important;
  background: transparent !important;
}

.memory-palace-v3.thought-pool-shell .thought-status-control button {
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

.memory-palace-v3.dream-fragments-shell .dream-wisp-actions button {
  border-color: var(--color-border) !important;
  background: transparent !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
  box-shadow: none !important;
}

.memory-palace-v3.dream-fragments-shell .dream-wisp-actions button.active {
  border-color: var(--color-border-strong) !important;
  background: var(--color-accent-soft) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode {
  overflow: hidden !important;
  background: var(--color-surface-raised) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode :is(
  .interest-drawer-cloud, .interest-drawer-cloud-field, .interest-drawer-stage-tools
) {
  background: transparent !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode .interest-drawer-stage-tools {
  border-color: var(--color-border) !important;
}

/* The detail sheet reads as one document rather than a stack of dark cards. */
.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet :is(
  section, article, .interest-drawer-detail-state, .interest-drawer-topic-reason,
  .interest-drawer-thought-seeds, .interest-drawer-backflow-panel,
  .interest-drawer-related-list, .interest-drawer-status-rows > div
) {
  border-color: transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-sheet :is(
  .interest-drawer-detail-state, .interest-drawer-topic-reason,
  .interest-drawer-thought-seeds, .interest-drawer-backflow-panel,
  .interest-drawer-related-list
) {
  padding-inline: 0 !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-detail-meta span,
.memory-palace-v3.interest-drawer-shell .interest-drawer-thought-seeds article button {
  border-color: var(--color-border) !important;
  background: var(--color-accent-soft) !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

.memory-palace-v3 :is(
  .mem-maint-head, .mem-maint-head strong, .mem-maint-item strong,
  .memory-room-relocation-card header strong, .memory-lifecycle-card header strong,
  .memory-merge-card header strong
) {
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

.memory-palace-v3 :is(.mem-maint-head .material-symbols-outlined, .memory-action-icon, .memory-review-icon) {
  color: var(--color-ornament) !important;
  -webkit-text-fill-color: var(--color-ornament) !important;
}

.memory-palace-v3 :is(
  .mem-maint-item span, .memory-room-relocation-card header span,
  .memory-lifecycle-card header span, .memory-merge-card header span,
  .memory-room-relocation-item small
) {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3 :is(
  .mem-maintenance-card, .mem-maint-item, .mem-maint-results .home-card,
  .memory-lifecycle-stats > span, .memory-lifecycle-coverage > span,
  .memory-room-relocation-tags > span
) {
  border-color: var(--color-border) !important;
  background: var(--color-surface-raised) !important;
  color: var(--color-text) !important;
  -webkit-text-fill-color: var(--color-text) !important;
  box-shadow: none !important;
}

.memory-palace-v3 :is(
  .mem-maint-actions button, .mem-maint-grid button,
  .memory-lifecycle-actions button, .memory-room-relocation-actions button
) {
  border-color: var(--color-border) !important;
  background: transparent !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

/* Phase 13 — selected filters and expanded traces use each preset's own
   accent/ornament pair; no literal pink survives in these states. */
.memory-palace-v3.thought-pool-shell .thought-pool-filters button,
.memory-palace-v3.dream-fragments-shell .dream-fragments-filters button {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  box-shadow: none !important;
}

.memory-palace-v3.thought-pool-shell .thought-pool-filters button.active,
.memory-palace-v3.dream-fragments-shell .dream-fragments-filters button.active,
.memory-palace-v3.dream-fragments-shell .dream-fragments-filters button[data-dream-filter="question"].active {
  border-color: var(--color-border-strong) !important;
  background: var(--color-accent-soft) !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
  box-shadow: none !important;
}

.memory-palace-v3.thought-pool-shell .thought-echo-status {
  background: transparent !important;
  color: var(--color-ornament) !important;
  -webkit-text-fill-color: var(--color-ornament) !important;
}

.memory-palace-v3.thought-pool-shell .thought-echo-status i,
.memory-palace-v3.thought-pool-shell .thought-lifecycle-note li::before {
  background: var(--color-ornament) !important;
  box-shadow: none !important;
}

.memory-palace-v3.thought-pool-shell .thought-lifecycle-note li,
.memory-palace-v3.thought-pool-shell .thought-echo[data-state] .thought-lifecycle-note li,
.memory-palace-v3.thought-pool-shell .thought-echo[data-state] .thought-echo-detail p {
  color: var(--color-text-muted) !important;
  -webkit-text-fill-color: var(--color-text-muted) !important;
  opacity: 1 !important;
}

.memory-palace-v3.thought-pool-shell .thought-source-trail :is(span, em),
.memory-palace-v3.thought-pool-shell .thought-source-trail span:not(:last-child)::after {
  color: var(--color-ornament) !important;
  -webkit-text-fill-color: var(--color-ornament) !important;
}

.memory-palace-v3.thought-pool-shell .thought-echo[data-state] .thought-status-control,
.memory-palace-v3.thought-pool-shell .thought-echo[data-state] .thought-feeling-trace {
  border-color: var(--color-border) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.memory-palace-v3.dream-fragments-shell .dream-wisp-actions button,
.memory-palace-v3.dream-fragments-shell .dream-wisp-actions button.active {
  border-color: var(--color-border-strong) !important;
  background: transparent !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
  box-shadow: none !important;
}

/* The cloud is one continuous rounded field, including its filters. */
.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode,
.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode .interest-drawer-stage-backdrop {
  background: var(--color-surface-raised) !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode .interest-drawer-cloud {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.memory-palace-v3.interest-drawer-shell .interest-drawer-stage.cloud-mode .interest-drawer-stage-tools {
  border: 0 !important;
  background: transparent !important;
}

/* Fate choices are one reusable capsule system. Legacy Dream-kind palettes
   may change the copy, but never repaint the controls pink or violet. */
.memory-palace-v3.dream-fragments-shell .dream-wisp-fate button,
.memory-palace-v3.dream-fragments-shell .dream-wisp[data-dream-kind] .dream-wisp-fate button {
  border-color: var(--color-border-strong) !important;
  background: transparent !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
  box-shadow: none !important;
}

.memory-palace-v3.dream-fragments-shell .dream-wisp-fate button.active,
.memory-palace-v3.dream-fragments-shell .dream-wisp[data-dream-kind] .dream-wisp-fate button.active {
  border-color: var(--color-accent) !important;
  background: var(--color-accent-soft) !important;
  color: var(--color-accent) !important;
  -webkit-text-fill-color: var(--color-accent) !important;
}

/* Gaze keeps one themed outer sheet. The detail copy inside stays transparent,
   so there is no second white paper card and the text never sits on the map. */
body[data-app-theme] .memory-palace-v3.interest-drawer-shell .interest-drawer-sheet-backdrop {
  background: var(--color-overlay) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-app-theme] .memory-palace-v3.interest-drawer-shell .interest-drawer-sheet-backdrop .interest-drawer-sheet {
  border: 1px solid var(--color-border-strong) !important;
  border-bottom: 0 !important;
  border-radius: 28px 28px 0 0 !important;
  background: var(--color-panel-solid) !important;
  background-color: var(--color-panel-solid) !important;
  background-image: none !important;
  box-shadow: var(--shadow-modal) !important;
  padding-top: 38px !important;
}

body[data-app-theme] .memory-palace-v3.interest-drawer-shell .interest-drawer-sheet::before {
  content: none !important;
}
