/* Ambient scene layers: each PNG is a full painted composition, never an avatar. */
.character-scene {
  position: absolute;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}
.character-scene--welcome { background-image: url('./assets/scenes/welcome.png?v=1'); }
.character-scene--monthly-empty { background-image: url('./assets/scenes/monthly-empty.png?v=1'); }
.character-scene--monthly-reflection { background-image: url('./assets/scenes/monthly-reflection.png?v=1'); }
.character-scene--register { background-image: url('./assets/scenes/register.png?v=1'); }
.character-scene--budget { background-image: url('./assets/scenes/budget.png?v=1'); }
.character-scene--budget-alert { background-image: url('./assets/scenes/budget-alert.png?v=1'); }
.character-scene--distribution { background-image: url('./assets/scenes/distribution.png?v=1'); }
.character-scene--commitments { background-image: url('./assets/scenes/commitments.png?v=1'); }
.character-scene--commitment-near-end { background-image: url('./assets/scenes/small-win.png?v=1'); }
.character-scene--reports { background-image: url('./assets/scenes/reports.png?v=1'); }
.character-scene--report-reflection { background-image: url('./assets/scenes/rest.png?v=1'); }
.character-scene--settings { background-image: url('./assets/scenes/settings.png?v=1'); }
.character-scene--import { background-image: url('./assets/scenes/import.png?v=1'); }
.character-scene--export { background-image: url('./assets/scenes/export.png?v=1'); }
.character-scene--success { background-image: url('./assets/scenes/success.png?v=1'); }
.character-scene--rest { background-image: url('./assets/scenes/rest.png?v=1'); }
.character-scene--loading { background-image: url('./assets/scenes/loading.png?v=1'); }
.character-scene--explore { background-image: url('./assets/scenes/explore.png?v=1'); }
.character-scene--no-results { background-image: url('./assets/scenes/no-results.png?v=1'); }
.character-scene--unexpected { background-image: url('./assets/scenes/unexpected.png?v=1'); }
.character-scene--month-close { background-image: url('./assets/scenes/month-close.png?v=1'); }
.character-scene--reminder { background-image: url('./assets/scenes/reminder.png?v=1'); }
.character-scene--small-win { background-image: url('./assets/scenes/small-win.png?v=1'); }
.character-scene--small { background-size: 90% auto; }
.character-scene--regular,
.character-scene--large { background-size: contain; }

/* Welcome: a shared household scene inhabits the open side of the hero. */
.hero--illustrated {
  min-height: 196px;
  align-items: center;
  isolation: isolate;
}
.hero.hero--illustrated::after { content: none; }
.hero--illustrated .hero-copy {
  position: relative;
  z-index: 1;
  width: min(48%, 430px);
}
.hero--illustrated .rightnote { position: relative; z-index: 1; max-width: 255px; }
.hero--illustrated > .character-scene {
  z-index: 0;
  right: -5px;
  bottom: -2px;
  width: 54%;
  height: 100%;
  background-position: right bottom;
}
.hero--commitments { min-height: 178px; padding-right: 30px; }
.hero--commitments > .character-scene { right: 12px; width: min(42%, 430px); background-position: right center; }

/* Scene stages leave the illustration in the page's open space beside content. */
.scene-stage {
  position: relative;
  min-height: 145px;
  overflow: hidden;
  isolation: isolate;
}
.scene-stage > .character-scene {
  inset: 0 2% 0 auto;
  width: min(62%, 430px);
  height: 100%;
  background-position: right center;
}
.scene-stage--register { min-height: 158px; margin: -5px 0 8px; }
.scene-stage--budget { min-height: 154px; margin: -6px 0 8px; }
.scene-stage--budget.scene-stage--alert > .character-scene { width: min(55%, 390px); }
.scene-stage--distribution,
.scene-stage--reports,
.scene-stage--settings { min-height: 142px; margin: -5px 0 8px; }
.scene-stage--commitment-near-end { min-height: 120px; margin: -8px 0 5px; }
.scene-stage--commitment-near-end > .character-scene { width: min(42%, 250px); }
.backup-scenes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.backup-action { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 132px; overflow: hidden; }
.backup-action > .character-scene { inset: 0; width: 100%; height: 100%; background-position: center bottom; }
.backup-action .btn { position: relative; z-index: 1; margin-bottom: 3px; }

/* Activity empty state: copy and the complete desk scene share one landscape. */
.character-empty-state {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 190px;
  overflow: hidden;
  isolation: isolate;
  padding: 9px 0 10px 2px;
}
.character-empty-state__copy {
  position: relative;
  z-index: 1;
  width: 52%;
  max-width: 300px;
}
.character-empty-state__copy strong {
  color: #4b5143;
  font: 500 17px 'Newsreader', Georgia, serif;
}
.character-empty-state__copy p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  margin: 7px 0 11px;
}
.character-empty-state > .character-scene {
  z-index: 0;
  right: -6px;
  bottom: -2px;
  width: 56%;
  height: 100%;
  background-position: right bottom;
}

/* Salem rests within the reflection card; the text stays legible over its calm side. */
.reflection-card {
  position: relative;
  min-height: 225px;
  overflow: hidden;
  isolation: isolate;
}
.reflection-card__copy {
  position: relative;
  z-index: 1;
  width: 59%;
}
.reflection-card > .character-scene {
  z-index: 0;
  right: 0;
  bottom: 0;
  width: 52%;
  height: 78%;
  background-position: right bottom;
}
.toast[data-scene] { position: relative; overflow: hidden; isolation: isolate; background: #e7e9dc; color: #46513f; border: 1px solid var(--line); }
.toast[data-scene]::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -9px;
  width: 105px;
  height: 70px;
  background: var(--toast-scene) no-repeat right bottom / contain;
  opacity: .9;
  pointer-events: none;
}
.toast[data-scene="success"] { --toast-scene: url('./assets/scenes/success.png?v=1'); padding-right: 85px; }
.toast[data-scene="unexpected"] { --toast-scene: url('./assets/scenes/unexpected.png?v=1'); padding-right: 85px; }
.toast[data-scene="export"] { --toast-scene: url('./assets/scenes/export.png?v=1'); padding-right: 85px; }

@media (max-width: 1050px) {
  .scene-stage > .character-scene { width: 67%; }
}
@media (max-width: 720px) {
  .hero--illustrated {
    min-height: 228px;
    align-items: flex-start;
    padding: 19px 18px;
  }
  .hero--illustrated .hero-copy { width: 68%; }
  .hero--illustrated .rightnote { max-width: 225px; font-size: 11px; }
  .hero--illustrated > .character-scene {
    right: -8px;
    bottom: -4px;
    width: 72%;
    height: 65%;
    background-position: right bottom;
  }
  .hero--commitments { min-height: 210px; }
  .hero--commitments > .character-scene { right: 8px; width: min(62%, 300px); height: 67%; background-position: right bottom; }
  .scene-stage--register { min-height: 139px; }
  .scene-stage--budget { min-height: 169px; }
  .scene-stage--distribution,
  .scene-stage--reports,
  .scene-stage--settings { min-height: 130px; }
  .scene-stage--commitment-near-end { min-height: 110px; }
  .backup-action { min-height: 122px; }
  .scene-stage > .character-scene { inset: 0 0 0 auto; width: 76%; }
  .character-empty-state { min-height: 190px; }
  .character-empty-state__copy { width: 50%; }
  .character-empty-state__copy strong { font-size: 16px; }
  .character-empty-state > .character-scene { right: -9px; width: 52%; height: 94%; }
  .reflection-card { min-height: 213px; }
  .reflection-card__copy { width: 64%; }
  .reflection-card > .character-scene { width: 56%; height: 68%; right: -3px; }
}
/* Mi Mes: composición panorámica para pantallas amplias, conservando el flujo móvil. */
@media (min-width: 1200px) {
  .app { grid-template-columns: 264px minmax(0, 1fr); }
  .main { max-width: none; padding: 24px clamp(28px, 2vw, 48px) 42px; }
  .top { margin-bottom: 21px; }
  .month-dashboard .hero--illustrated {
    min-height: 232px;
    height: 232px;
    padding: 25px 30px;
    margin-bottom: 15px;
    overflow: hidden;
  }
  .month-dashboard .hero--illustrated .hero-copy {
    position: relative;
    z-index: 1;
    width: 37%;
    max-width: 520px;
  }
  .month-dashboard .hero--illustrated .hero-copy h2 { font-size: 30px; }
  .month-dashboard .hero--illustrated > .rightnote {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 24px;
    width: min(19%, 230px);
    max-width: none;
    margin: 0;
    transform: translateY(-50%);
    font-family: 'Newsreader', Georgia, serif;
    font-size: 17px;
    font-style: italic;
    line-height: 1.4;
  }
  .month-dashboard .hero--illustrated > .character-scene {
    z-index: 0;
    right: 16%;
    bottom: 0;
    width: 47%;
    height: 100%;
    background-position: center bottom;
    background-size: contain;
  }
  .month-dashboard > .grid.cols4 { gap: 13px; margin-bottom: 16px; }
  .month-dashboard .month-feature-cards { grid-template-columns: 1.04fr 1fr; gap: 15px; }
  .month-dashboard .month-feature-cards > .card { min-height: 250px; }
  .month-dashboard .month-budget-heading { margin-top: 24px; }
  .month-dashboard .reflection-card { min-height: 250px; }
  .month-dashboard .reflection-card__copy { width: 58%; }
  .month-dashboard .reflection-card > .character-scene { width: 51%; height: 83%; }
}
@media (max-width: 720px) {
  .month-dashboard .hero--illustrated > .rightnote { display: none; }
  .month-dashboard .month-feature-cards { margin-top: 12px !important; }
  .month-dashboard .month-budget-heading { margin-top: 21px; }
}

/* Acciones de gestión sutiles para movimientos y compromisos. */
.managed-row__end { display:flex; flex-direction:column; align-items:flex-end; gap:5px; }
.record-actions { display:flex; justify-content:flex-end; gap:5px; opacity:0; transition:opacity .16s ease; }
.managed-row:hover .record-actions, .managed-row:focus-within .record-actions, .record-actions--always { opacity:1; }
.record-action { border:0; background:transparent; color:#707564; padding:3px 5px; border-radius:6px; font-size:10px; line-height:1.2; }
.record-action:hover, .record-action:focus-visible { background:#edf0e5; color:#46563e; outline:none; }
.record-action.is-delete { color:#9b7565; }
.record-action.is-delete:hover, .record-action.is-delete:focus-visible { background:#f4e6df; color:#875641; }
.table td:last-child { width:126px; }
@media (max-width:720px) {
 .record-actions { opacity:1; }
 .record-action { padding:5px 6px; }
 .managed-row__end { gap:7px; }
}
.record-actions { opacity: .72; }
.managed-row:hover .record-actions, .managed-row:focus-within .record-actions, .record-actions--always { opacity: 1; }
.budget-modal { width:min(620px,100%); }
.budget-edit-list { display:grid; gap:0; max-height:55vh; overflow:auto; padding-right:5px; margin:0 0 15px; }
.budget-edit-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 4px; border-bottom:1px solid #efebe2; color:#52584c; font-size:12px; cursor:text; }
.budget-edit-row:last-child { border-bottom:0; }
.budget-edit-input { display:flex; align-items:center; gap:6px; color:#8c8c7e; }
.budget-edit-input input { width:150px; border:1px solid var(--line); background:#fffefa; padding:9px 10px; border-radius:9px; color:var(--ink); text-align:right; outline:none; font-variant-numeric:tabular-nums; }
.budget-edit-input input:focus { border-color:var(--olive); box-shadow:0 0 0 3px #89927418; }
@media (max-width:480px) {
  .budget-edit-row { font-size:11px; gap:8px; }
  .budget-edit-input input { width:122px; }
  .budget-modal .modal-head h2 { font-size:21px; }
}

/* Shared editorial entrance; each module keeps its own words and scene. */
.editorial-hero {
  min-height: 164px;
  padding: 22px 26px;
  margin: 0 0 17px;
  isolation: isolate;
}
.editorial-hero .hero-copy {
  width: min(54%, 560px);
  max-width: 560px;
}
.editorial-hero .hero-copy h2 { max-width: 560px; }
.editorial-hero__description {
  max-width: 430px;
  margin-top: 7px;
  color: #647056;
  font-size: 12px;
  line-height: 1.55;
}
.editorial-hero > .rightnote {
  max-width: 245px;
  font-size: 12px;
  line-height: 1.55;
}
.editorial-hero--register { background: linear-gradient(112deg,#e7ebdd 0%,#f1eddf 73%,#e4dccb 100%); }
.editorial-hero--budget { background: linear-gradient(112deg,#e9ecdf 0%,#f3efdf 73%,#e8deca 100%); }
.editorial-hero--distribution { background: linear-gradient(112deg,#e4e9d9 0%,#f1eddf 68%,#e2dcc9 100%); }
.editorial-hero--commitments { background: linear-gradient(112deg,#e6eadb 0%,#eeeadc 74%,#e3dbc9 100%); }
.editorial-hero--reports { background: linear-gradient(112deg,#ebe9dc 0%,#f4eee1 73%,#e8ddc9 100%); }
.editorial-hero--settings { background: linear-gradient(112deg,#e5e9dd 0%,#f2eddf 73%,#e4dccb 100%); }
.editorial-hero--register > .character-scene { right: 9px; width: 41%; height: 98%; background-position: right bottom; }
.editorial-hero--budget > .character-scene { right: 9px; width: 42%; height: 98%; background-position: right bottom; }
.editorial-hero--distribution > .character-scene { right: 8px; width: 45%; height: 100%; background-position: right bottom; }
.editorial-hero--reports > .character-scene { right: 8px; width: 40%; height: 98%; background-position: right bottom; }
.editorial-hero--settings > .character-scene { right: 9px; width: 44%; height: 98%; background-position: right bottom; }
.editorial-hero--commitments > .character-scene { right: 12px; width: min(42%,430px); height: 100%; background-position: right bottom; }
@media (max-width: 720px) {
  .editorial-hero { min-height: 208px; padding: 19px 18px; align-items: flex-start; }
  .editorial-hero .hero-copy { width: 68%; }
  .editorial-hero__description { max-width: 250px; font-size: 11px; line-height: 1.45; }
  .editorial-hero > .rightnote { display: none; }
  .editorial-hero--monthly > .character-scene,
  .editorial-hero--register > .character-scene,
  .editorial-hero--budget > .character-scene,
  .editorial-hero--distribution > .character-scene,
  .editorial-hero--reports > .character-scene,
  .editorial-hero--settings > .character-scene,
  .editorial-hero--commitments > .character-scene {
    right: 7px;
    bottom: 5px;
    width: min(62%,285px);
    height: 62%;
    background-position: right bottom;
  }
  .month-dashboard .editorial-hero { min-height: 228px; }
}
