/* Chatamba memory page /chat/memory/ (CMP-008 S-11 design, boards MemoryChat / MemoryChatMobile).
   Plain CSS, nothing from another origin (MEMORY_CSP: style-src 'self', no font-src), so Manrope
   applies only where it is installed and the stack falls back to the system font. Light only:
   the brand site has no dark mode. */
.chatamba-page {
  --m-ground: #FFF9F1;
  --m-ink: #12253F;
  --m-muted: #4A5A6E;
  --m-surface: #FFFFFF;
  --m-line: #E6DED1;
  --m-link: #00756D;
  --m-warn: #FDE7E2;
  --m-danger: #B83A2B;
  color-scheme: light;
  margin: 0;
  min-height: 100vh;
  background: var(--m-ground);
  color: var(--m-ink);
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.chatamba-page *, .chatamba-page *::before, .chatamba-page *::after { box-sizing: border-box; }

.m-main {
  display: flex; flex-direction: column; gap: 24px;
  max-width: 760px; margin: 0 auto; padding: 40px 24px 64px;
}
.m-main > * { margin: 0; }
.m-title { font-size: 40px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }

.chatamba-page a { color: var(--m-link); }

/* Small outlined buttons: «← Вернуться в чат», «Настройки cookie», «Удалить», the address pair. */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 8px 18px;
  border: 2px solid var(--m-ink); border-radius: 16px; background: transparent;
  color: var(--m-ink); font: inherit; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.chatamba-page a.m-btn { color: var(--m-ink); }
.m-btn:hover { background: rgba(18, 37, 63, 0.06); }
.m-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.m-back { align-self: flex-start; }
.chatamba-page a:focus-visible, .chatamba-page button:focus-visible {
  outline: 3px solid var(--m-ink); outline-offset: 2px;
}

.m-off {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 20px 24px; border-radius: 24px; background: var(--m-warn);
}
.m-off p { margin: 0; }

#chatamba-memory, #chatamba-memory [data-section="data"] { display: flex; flex-direction: column; gap: 24px; }

.m-card {
  margin: 0; padding: 28px; border: 1px solid var(--m-line); border-radius: 24px;
  background: var(--m-surface);
}
.m-card > :first-child { margin-top: 0; }
.m-card > :last-child { margin-bottom: 0; }
.m-card h2 { margin: 0 0 16px; font-size: 22px; font-weight: 800; line-height: 1.25; }
.m-card h3 { margin: 24px 0 12px; font-size: 18px; font-weight: 800; }
.m-muted { color: var(--m-muted); font-size: 14px; }
.m-empty { color: var(--m-muted); }

.m-dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.m-dl dt { color: var(--m-muted); }
.m-dl dd { margin: 0; font-weight: 600; }

.m-items { list-style: none; margin: 0; padding: 0; }
.m-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 0;
  border-top: 1px solid var(--m-line);
}
.m-item:first-child { border-top: 0; padding-top: 0; }
.m-item-body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.m-item-label { display: block; color: var(--m-muted); font-size: 14px; font-weight: 600; }
.m-item .m-btn { flex: 0 0 auto; }

.m-address { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 12px; }
.m-seg { display: inline-flex; }
.m-seg .m-btn { border-radius: 0; }
.m-seg .m-btn:first-child { border-radius: 16px 0 0 16px; }
.m-seg .m-btn + .m-btn { border-left-width: 0; border-radius: 0 16px 16px 0; }
.m-seg .m-btn[aria-pressed="true"] { background: var(--m-ink); color: var(--m-ground); }

.m-consents { margin: 0; padding-left: 20px; }
.m-consents li + li { margin-top: 6px; }

.m-danger { border-color: var(--m-danger); }
.m-danger p { margin: 0 0 16px; }
.m-btn-danger { border-color: var(--m-danger); color: var(--m-danger); }
.m-btn-danger:hover { background: rgba(184, 58, 43, 0.06); }

.cb-memory-error { margin: 12px 0 0; color: var(--m-danger); font-weight: 600; }
.cb-memory-done { margin: 0; font-weight: 600; }

@media (max-width: 600px) {
  .m-main { padding: 20px 16px 48px; gap: 20px; }
  .m-title { font-size: 28px; }
  .m-card { padding: 16px; border-radius: 20px; }
  .m-off { padding: 16px; border-radius: 20px; }
  .m-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .m-dl dd + dt { margin-top: 10px; }
  .m-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .m-btn-danger { width: 100%; }
}
