/* Owner-requested next-branch presentation only. No shell/menu layout rules. */
.promises-state-memory-search { display: flex; flex-direction: column; height: auto; min-height: 100%; }
.promises-state-memory-result-count { flex: none; margin: 12px 0 4px; }
.promises-state-memory-results { flex: none; overflow: visible; }
.promises-state-memory-result { grid-template-columns: minmax(0, 1fr); }
.promises-state-memory-result span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }

/* Clip only the photo canvas; placements and book-coordinate transforms stay intact. */
body .promises-book .promises-story-page .promises-story-canvas { overflow: hidden; clip-path: inset(0 round 7px); }
.promises-story-canvas.has-background-photo .promises-story-wash-layer { background: rgba(255, 249, 239, .35); }
body .promises-book .promises-story-page.promises-template-page { grid-template-rows: auto auto minmax(0, 1fr) auto; }
body .promises-book .promises-template-body { overflow-y: auto; overscroll-behavior: contain; }

/* The already-existing personal-story presence class controls only free space. */
@media (min-width: 761px) and (min-height: 601px), (min-width: 1025px) {
  .miles-state-sheet[data-planner-mode="stateStory"]:not(.has-personal-story) .miles-state-sheet__tips {
    height: calc(var(--dossier-actions-top, 76.1%) - var(--dossier-previews-top, 30.1%) - 3%);
  }
  .miles-state-sheet[data-planner-mode="stateStory"]:not(.has-personal-story) .miles-tip-preview p { -webkit-line-clamp: 5; }
}

@media (max-width: 760px), (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  .promises-cover-entrance { padding-inline: 12px; grid-template-rows: auto auto; align-content: center; gap: 12px; }
  .promises-cover-object { width: min(100%, 500px); max-width: 100%; max-height: none; }
  .promises-cover-image { width: 100%; height: auto; max-height: none; }
  .promises-cover-arrow { position: static; transform: none; justify-self: center; }
  body .promises-book-stage { --promises-single-book-width: min(calc(100vw - 24px), 620px); }

  /* Intensify the existing soft radial light, never outline the hit rectangles. */
  body :is(.miles-cabinet-hotspot, .miles-plans-basket-hotspot, .road-ideas-hotspot)::before {
    background: radial-gradient(ellipse at center, rgba(255, 216, 125, .78), rgba(232, 184, 91, .4) 38%, transparent 72%);
    box-shadow: none;
    filter: blur(4px);
    opacity: .88;
    animation: bureau-glow-pulse 3.2s ease-in-out infinite;
  }
  body .miles-return-ticket { animation: bureau-ticket-glow 3.2s ease-in-out infinite; }
  .miles-scene:has(.miles-filing-drawer.is-open) .miles-return-ticket { visibility: hidden; }
  body .miles-filing-drawer.is-open { top: 8%; left: 2%; width: 96%; }

  /* The original 4:3 artwork and clear pocket bound preview content. */
  body .miles-state-sheet[data-planner-mode="myPlans"] { aspect-ratio: 1448 / 1086; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .miles-state-sheet__clippings-panel { top: 26.2%; left: 16.8%; width: 29.2%; height: 52.3%; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-keepsakes,
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-keepsakes:not(.is-empty),
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-keepsakes.pocket-keepsakes--small-screen {
    position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0;
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 3px;
  }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-heading { font-size: .65rem; margin: 0; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-stack { margin: 3px 8px 8px 0; min-height: 0; max-height: none; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-card { padding: 4px; gap: 2px; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-card strong { font-size: clamp(.62rem, 2.4vw, .85rem); }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-card p { font-size: clamp(.56rem, 2vw, .8rem); line-height: 1.25; margin: 0; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-add { position: absolute; top: calc(100% + 6px); left: -12px; width: calc(50% + 10px); min-width: 0; padding: 3px; font-size: .6rem; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-controls { position: absolute; top: calc(100% + 6px); right: -12px; width: calc(50% + 10px); min-height: 0; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-controls button { width: 100%; padding: 3px; font-size: .65rem; }
  body .miles-state-sheet[data-planner-mode="myPlans"] .pocket-keepsakes.is-empty > p { font-size: .7rem; overflow-wrap: anywhere; }

  body #license-plate-collection .plate-room-controls select { background: linear-gradient(#fff9ef, #e8d4b4); color: #0a3161; border-color: #c9a35e; }
}
@media (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
  .promises-cover-object { width: min(100%, 350px); }
}
@keyframes bureau-glow-pulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
@keyframes bureau-ticket-glow {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255, 216, 125, .65)) drop-shadow(0 9px 13px rgba(31, 14, 4, .22)); }
  50% { filter: drop-shadow(0 0 22px rgba(255, 216, 125, .95)) drop-shadow(0 9px 13px rgba(31, 14, 4, .22)); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce), (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) and (prefers-reduced-motion: reduce) {
  body :is(.miles-cabinet-hotspot, .miles-plans-basket-hotspot, .road-ideas-hotspot)::before { animation: none; }
  body .miles-return-ticket { animation: none; filter: drop-shadow(0 0 18px rgba(255, 216, 125, .85)) drop-shadow(0 9px 13px rgba(31, 14, 4, .22)); }
}
