.memory-page { --memory-muted: var(--sub); }
.memory-page [hidden] { display: none !important; }
.memory-intro { margin-bottom: 32px; }
.memory-intro h1 { margin: 0 0 14px; font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.4; }
.memory-intro p { margin: 0; }
.memory-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.memory-form { min-width: 0; padding: 24px; border: 2px solid var(--ink); border-radius: var(--radius-md); background: var(--white); }
.memory-page .memory-form h2 { margin: 0 0 20px; padding: 0; border: 0; font-size: 1.3rem; line-height: 1.4; }
.memory-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.memory-fields label { display: flex; min-width: 0; flex-direction: column; gap: 6px; font-size: .875rem; font-weight: 700; }
.memory-fields input, .memory-fields select, .memory-share input { min-width: 0; width: 100%; min-height: 48px; padding: 8px 10px; color: var(--ink); background: var(--white); border: 1px solid var(--sub); border-radius: 8px; }
.memory-page .memory-btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 18px; border: 2px solid var(--ink); border-radius: 10px; background: var(--ink); color: var(--white); font-weight: 700; cursor: pointer; line-height: 1.5; }
.memory-page .memory-btn--secondary { color: var(--ink); background: var(--white); }
.memory-page .memory-btn:hover { text-decoration: underline; text-underline-offset: .2em; }
.memory-page .memory-btn:disabled { cursor: default; opacity: .55; text-decoration: none; }
.memory-page :is(button, input, select, a):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.memory-page .memory-note { color: var(--memory-muted); font-size: .875rem; line-height: 1.8; margin: 12px 0 0; }
.memory-selection { margin-block: 28px 40px; padding: 22px 24px; border: 2px solid var(--ink); border-radius: var(--radius-md); background: var(--surface); }
.memory-page .memory-selection h2 { margin: 0; padding: 0; border: 0; font-size: 1.2rem; line-height: 1.5; }
.memory-selection h2 span { white-space: nowrap; margin-left: .6em; font-size: .95rem; }
.memory-selection .memory-note:empty { display: none; }
.memory-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.memory-share { margin-top: 20px; }
.memory-share label { display: block; font-weight: 700; font-size: .875rem; margin-bottom: 6px; }
#memory-saved { margin-top: 20px; background: var(--white); border-radius: 10px; }
.memory-page .memory-results > h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.5; }
.memory-results > .memory-note { max-width: 48em; margin-bottom: 24px; }
.memory-columns { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 24px; }
.memory-columns[data-memory-view="anime"], .memory-columns[data-memory-view="manga"] { grid-template-columns: 1fr; }
.memory-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.memory-filter .memory-btn[aria-pressed="true"] { background: var(--ink); color: var(--white); }
#memory-results-title { scroll-margin-top: 150px; }
.memory-panel { min-width: 0; padding: 20px; border: 2px solid var(--ink); border-radius: var(--radius-md); background: var(--white); }
.memory-panel__heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.memory-page .memory-panel h3 { font-size: 1.4rem; margin: 0; line-height: 1.4; }
.memory-count { font-size: .875rem; color: var(--sub); }
.memory-list { list-style: none; margin: 0; padding: 0; }
.memory-work { padding: 18px 0; border-bottom: 1px solid var(--line); }
.memory-work:last-child { border-bottom: 0; }
.memory-work__title { display: inline-block; padding-block: 2px; font-weight: 700; overflow-wrap: anywhere; }
.memory-work__detail, .memory-work__period { margin: 5px 0 0; color: var(--sub); font-size: .8125rem; line-height: 1.65; overflow-wrap: anywhere; }
.memory-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 9px 4px 0; margin-top: 5px; cursor: pointer; font-size: .8125rem; }
.memory-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.memory-check:has(input:checked) { font-weight: 700; }
.memory-more { width: 100%; margin-top: 14px; }
.memory-panel__source { border-top: 1px solid var(--line); padding-top: 12px; }
.memory-message { padding: 16px 20px; border: 2px solid var(--ink); background: var(--white); border-radius: 10px; }
.memory-start-note { margin-bottom: 32px !important; }
#memory-saved .memory-work { padding-inline: 16px; }
#memory-saved > .memory-note { padding: 16px; }
@media (max-width: 680px) {
  #memory-results-title { scroll-margin-top: 245px; }
  .memory-forms, .memory-columns { grid-template-columns: 1fr; gap: 18px; }
  .memory-form, .memory-panel { padding: 20px; }
  .memory-selection { padding: 20px; }
  .memory-actions { flex-direction: column; align-items: stretch; }
  .memory-fields { gap: 10px; }
  .memory-fields select { padding-inline: 5px; font-size: .9rem; }
}
