/* Seção Memória (js/memory.js): a tela de Memória do app, escura como lá (LunaApp/src/memory). */
.mem-sec { position: relative; margin-top: 140px; padding: 120px 24px 110px; background: #0B0B0C; color: #F2F2F0; overflow: hidden; scroll-margin-top: 0; }
.mem-sec .sky { height: 100%; }
.mem-in { position: relative; z-index: 1; max-width: var(--page); margin: 0 auto; }
.mem-sec .chap h2 { color: #F2F2F0; }
.mem-sec .chap { position: relative; }
.mem-sec .chap::before { content: ''; position: absolute; inset: -40px -80px; z-index: -1; background: radial-gradient(ellipse farthest-side, #0B0B0CF5 62%, #0B0B0C00); pointer-events: none; }
.mem-sec .chap > p { color: #f2f2f0d9; }
.mem-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 12px 6px 10px; border-radius: var(--r-pill); background: #fc3b7f1c; color: #FF8FB6; font-size: 13px; font-weight: 800; }
.mem-eyebrow .ic { width: 16px; height: 16px; }

/* a janela */
.mm { border-radius: 18px; background: #111111; border: 1px solid #262626; box-shadow: 0 50px 120px #00000080, 0 0 0 1px #ffffff08; overflow: hidden; }
.mm-bar { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 14px 0 20px; border-bottom: 1px solid #222; background: #151515; }
.mm-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 120px; }
.mm-title b { font-size: 15px; font-weight: 800; }
.mm-title small { font-size: 12px; font-weight: 650; color: #8E8C93; font-variant-numeric: tabular-nums; }
.mm-seg { display: flex; padding: 3px; border-radius: 10px; background: #0C0C0C; border: 1px solid #242424; }
.mm-seg button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 700; color: #A3A1A8; }
.mm-seg button[aria-pressed="true"] { background: #2A2A2A; color: #F2F2F0; box-shadow: inset 0 1px 0 #ffffff12; }
.mm-seg button:focus-visible, .mm-grow:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.mm-search { display: flex; align-items: center; gap: 8px; width: 240px; height: 36px; padding: 0 12px; border-radius: 10px; background: #0C0C0C; border: 1px solid #242424; color: #8E8C93; }
.mm-search:focus-within { border-color: #fc3b7f99; }
.mm-search .ic { width: 15px; height: 15px; flex: none; }
.mm-search input { all: unset; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: #F2F2F0; }
.mm-search input::placeholder { color: #77757C; }
.mm-search input::-webkit-search-cancel-button { display: none; }
.mm-sp { flex: 1; }
.mm-grow { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 10px; background: linear-gradient(#272727, #1C1C1C); border: 1px solid #2E2E2E; font-size: 13px; font-weight: 700; color: #F2F2F0; }
.mm-grow:hover { border-color: #3A3A3A; }
.mm-grow:disabled { opacity: .45; cursor: default; }
.mm-grow .ic { width: 13px; height: 13px; color: var(--pink); }

.mm-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 600px; }
.mm-map { position: relative; min-width: 0; }
.mm-cv { display: block; width: 100%; height: 100%; touch-action: none; }
.mm-tip { position: absolute; left: 0; top: 0; translate: 0 0; transform: translate(-50%, -100%); pointer-events: none; padding: 5px 9px; border-radius: 8px; background: #000000e0; border: 1px solid #2c2c2c; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mm-legend { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; font-weight: 650; color: #8E8C93; pointer-events: none; }
.mm-legend li { display: flex; align-items: center; gap: 6px; }
.mm-legend i { width: 8px; height: 8px; border-radius: 50%; }
.mm-legend i.is-subj { width: 7px; height: 7px; border-radius: 1px; rotate: 45deg; background: #B8BAC48c; }

/* a mensagem que chega e o que vai junto */
.mm-recall { position: absolute; left: 16px; top: 16px; width: 300px; display: flex; flex-direction: column; gap: 8px; opacity: 0; translate: 0 -8px; transition: opacity .35s var(--ease), translate .35s var(--ease); pointer-events: none; }
.mm-recall.is-in { opacity: 1; translate: 0 0; }
.mm-msg { margin: 0; padding: 10px 12px; border-radius: 12px; background: #1E1E1E; border: 1px solid #2A2A2A; font-size: 13.5px; font-weight: 650; line-height: 1.45; }
.mm-msg small, .mm-rc small { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 750; color: #8E8C93; }
.mm-rc { margin-left: 18px; padding: 10px 12px; border-radius: 12px; background: #fc3b7f14; border: 1px solid #fc3b7f4d; }
.mm-rc small { display: flex; align-items: center; gap: 6px; color: #FF8FB6; }
.mm-rc small .ic { width: 13px; height: 13px; }
.mm-rc span { display: flex; align-items: center; gap: 7px; padding: 2px 0; font-size: 12.5px; font-weight: 700; }
.mm-rc i, .mm-links i, .mm-now li > i { flex: none; width: 7px; height: 7px; border-radius: 50%; }

/* a página aberta */
.mm-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #222; background: #141414; }
.mm-reader { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.mm-reader.is-in { animation: mm-in .4s var(--ease); }
@keyframes mm-in { from { opacity: 0; translate: 0 6px; } }
.mm-reader header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mm-reader header small { font-size: 12px; font-weight: 650; color: #8E8C93; text-align: right; }
.mm-kind { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--k) 16%, transparent); color: var(--k); font-size: 12px; font-weight: 800; }
.mm-kind::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.mm-reader h3 { margin-top: 14px; font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; }
.mm-by { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; font-size: 12.5px; font-weight: 650; color: #8E8C93; }
.mm-by img { width: 20px; height: 20px; border-radius: 50%; }
.mm-text { margin: 14px 0 0; font-size: 14.5px; font-weight: 550; line-height: 1.6; color: #D9D7DD; }
.mm-reader code { padding: 1px 5px; border-radius: 5px; background: #222; font: 500 12.5px var(--mono); color: #F2F2F0; }
.mm-subj { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.mm-subj span { padding: 3px 9px; border-radius: var(--r-pill); background: #1F1F1F; border: 1px solid #2A2A2A; font-size: 12px; font-weight: 700; color: #B8BAC4; }
.mm-h { margin: 18px 0 6px; font-size: 11.5px; font-weight: 800; color: #77757C; }
.mm-links { display: flex; flex-direction: column; gap: 2px; }
.mm-links button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #E4E2E8; }
.mm-links button:hover, .mm-links button:focus-visible { background: #1F1F1F; }
.mm-reader footer { display: flex; align-items: center; gap: 7px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #222; font: 500 11.5px var(--mono); color: #77757C; overflow-wrap: anywhere; }
.mm-reader footer .ic { flex: none; width: 14px; height: 14px; }
.mm-empty { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.55; color: #8E8C93; }

/* agora na memória */
.mm-now { padding: 14px 22px 16px; border-top: 1px solid #222; }
.mm-now small { font-size: 11.5px; font-weight: 800; color: #77757C; }
.mm-now ul { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; min-height: 84px; }
.mm-now li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #A3A1A8; animation: mm-in .45s var(--ease); }
.mm-now li img { flex: none; width: 20px; height: 20px; border-radius: 50%; }
.mm-now li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-now li b { color: #F2F2F0; font-weight: 750; }
.mm-now li em { font-style: normal; color: #E4E2E8; font-weight: 700; }

.mem-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; margin: 64px 0 0; padding: 32px 0 0; list-style: none; border-top: 1px solid #ffffff1f; }
.mem-facts .ic { color: #FF8FB6; }
.mem-facts h3 { margin-top: 14px; font-size: 18px; font-weight: 800; }
.mem-facts p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: #f2f2f0b3; font-weight: 550; }

@media (max-width: 980px) {
  .mm-body { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mm-map { height: 440px; }
  .mm-side { border-left: 0; border-top: 1px solid #222; }
  .mm-reader { max-height: none; }
  .mem-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mem-sec { margin-top: 100px; padding: 88px 16px 80px; }
  .mm-bar { flex-wrap: wrap; height: auto; padding: 12px 14px; gap: 10px; }
  .mm-title { min-width: 0; flex: 1; }
  .mm-search { order: 3; width: 100%; }
  .mm-sp { display: none; }
  .mm-grow span { display: none; }
  .mm-map { height: 420px; }
  .mm-recall { display: none; }
  .mm-legend { left: 12px; right: 12px; gap: 4px 12px; font-size: 11px; }
  .mem-facts { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-reader.is-in, .mm-now li { animation: none; }
  .mm-recall { transition: none; }
}
