/* CareMo memoir: a quiet, readable family book inside the existing app. */
.memoir { --memoir-paper: #f8f5ed; --memoir-ink: #233c32; --memoir-muted: #5b685e; --memoir-line: #d8dfd5; color: var(--memoir-ink); }
.memoir, .memoir * { box-sizing: border-box; }
.memoir h1, .memoir h2, .memoir h3, .memoir p, .memoir label, .memoir button, .memoir summary { word-break: keep-all; overflow-wrap: anywhere; }
.memoir button, .memoir input, .memoir textarea, .memoir label, .memoir summary, .memoir a { font: inherit; }
.memoir button, .memoir .memoir-file-button, .memoir .memoir-link-button { min-height: 48px; }
.memoir button.primary, .memoir button.secondary { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; line-height: 1.5; cursor: pointer; }
.memoir button.primary { background: #285840; border-color: #285840; color: #fff; }
.memoir button.primary:hover:not(:disabled) { background: #1d4933; }
.memoir button.secondary { background: #f2f6ed; border-color: #b6c5b1; color: #274b33; }
.memoir button.secondary:hover:not(:disabled) { background: #e8efdf; }
.memoir button:disabled { cursor: not-allowed; opacity: .55; }
.memoir-account-notice { padding: 20px; margin: 16px 0 24px; background: #f7f0da; border: 1px solid #c9b67c; border-radius: 14px; }
.memoir-account-notice h2 { margin: 0 0 10px; font-size: 1.1rem; line-height: 1.6; }
.memoir-account-notice p { margin: 0 0 14px; font-size: .9rem; line-height: 1.8; }
.memoir-account-notice > div { display: flex; flex-wrap: wrap; gap: 8px; }
.memoir button:focus-visible, .memoir input:focus-visible, .memoir textarea:focus-visible, .memoir a:focus-visible, .memoir summary:focus-visible, .memoir .memoir-file-button:focus-within { outline: 3px solid #b96925; outline-offset: 4px; }
.memoir .eyebrow { font-size: .76rem; letter-spacing: .12em; font-weight: 700; color: #52705c; margin: 0 0 12px; }
.memoir-home { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 18px; padding: 26px 22px !important; background: var(--memoir-paper) !important; overflow: hidden; }
.memoir-home h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.35; margin: 0 0 14px; letter-spacing: -.04em; }
.memoir-home-copy > p:not(.eyebrow) { color: var(--memoir-muted); font-size: .94rem; line-height: 1.7; max-width: 34em; }
.memoir-link-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; text-decoration: none; border-radius: 13px; margin-top: 8px; background: #285840; color: #fff; font-weight: 700 !important; }
.memoir-cover-symbol { width: 108px; height: 156px; align-self: center; justify-self: end; border-radius: 3px 9px 9px 3px; border-left: 7px solid #b0b9a1; background: #dbe1d1; padding: 20px 14px; box-shadow: 8px 8px 0 #e4dfd1; display: flex; flex-direction: column; transform: rotate(6deg); }
.memoir-cover-symbol > span { font-family: Georgia, 'Batang', serif; font-size: 1.4rem; line-height: 1.45; letter-spacing: -.03em; }
.memoir-cover-symbol i { width: 22px; height: 1px; background: #78917c; margin: 12px 0 auto; }
.memoir-cover-symbol small { font-size: .6rem; letter-spacing: .14em; }
.memoir-hero { display: flex; justify-content: space-between; gap: 20px; padding: 30px 0 28px; border-bottom: 1px solid var(--memoir-line); }
.memoir-hero h1 { font-family: Georgia, 'Batang', serif; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.35; letter-spacing: -.06em; margin: 0 0 18px; }
.memoir-hero p:not(.eyebrow) { margin: 0; line-height: 1.75; color: var(--memoir-muted); }
.memoir-volume { display: flex; flex-direction: column; align-self: flex-start; font-family: Georgia, serif; font-size: 3.3rem; color: #748777; line-height: 1.1; padding-top: 26px; }
.memoir-volume small { font: 12px/1.5 sans-serif; text-align: center; margin-top: 10px; }
.memoir-privacy-note { font-size: .85rem; line-height: 1.7; padding: 14px 0 20px; color: #5e675d; margin: 0; }
.memoir-section-heading { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin: 24px 0 18px; }
.memoir-section-heading h2 { font-size: 1.3rem; line-height: 1.5; letter-spacing: -.035em; margin: 0; }
.memoir-section-heading h2 > span { margin-left: 6px; color: #66846c; }
.memoir-section-heading .eyebrow { margin-bottom: 5px; }
.memoir-section-heading > button { font-size: .88rem; flex-shrink: 0; }
.memoir-prompts { border: 1px solid var(--memoir-line); border-radius: 14px; background: #f8faf5; margin: 16px 0; }
.memoir-prompts > summary, .memoir-tools > summary { cursor: pointer; padding: 18px; min-height: 56px; font-weight: 700; }
.memoir-prompts > summary > span { display: block; margin: 4px 0 0; font-size: .82rem; font-weight: 400; color: var(--memoir-muted); }
.memoir-question-grid { padding: 0 12px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.memoir-question-grid button { text-align: left; border: 1px solid #d9e2d6; background: #fff; border-radius: 10px; padding: 14px 12px; color: var(--memoir-ink); }
.memoir-question-grid button:hover { background: #eef3e9; }
.memoir-question-grid small { display: block; font-size: .72rem; color: #5c775f; margin-bottom: 7px; }
.memoir-question-grid strong { font-size: .9rem; line-height: 1.6; display: block; }
.memoir-editor { margin-top: 18px; }
.memoir-editor fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
.memoir-editor label:not(.memoir-file-button) { display: block; font-weight: 700; font-size: 1rem; margin: 20px 0 9px; }
.memoir-editor label > span, .memoir-media-fields h3 > span { font-size: .76rem; font-weight: 400; color: var(--memoir-muted); margin-left: 6px; }
.memoir-editor input:not([type=file]), .memoir-editor textarea { display: block; width: 100%; min-width: 0; max-width: 100%; background: #fff; border: 1px solid #acbbae; border-radius: 11px; padding: 14px; font-size: 16px; line-height: 1.65; color: var(--memoir-ink); }
.memoir-editor input[type=date] { min-height: 55px; -webkit-appearance: none; appearance: none; }
.memoir-editor textarea { min-height: 230px; resize: vertical; }
.memoir-writing-hint { border-left: 3px solid #6e916e; background: #f2f6ed; padding: 16px 18px; border-radius: 0 10px 10px 0; }
.memoir-writing-hint strong { font-size: 1rem; line-height: 1.6; }
.memoir-writing-hint p { font-size: .86rem; margin: 5px 0 0; color: var(--memoir-muted); line-height: 1.6; }
.memoir-input-help { font-size: .76rem; color: var(--memoir-muted); line-height: 1.6; margin: 8px 0 20px; }
.memoir-media-fields { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--memoir-line); border-radius: 14px; }
.memoir-media-fields > section { padding: 18px; min-width: 0; }
.memoir-media-fields > section + section { border-left: 1px solid var(--memoir-line); }
.memoir-media-fields h3 { margin: 0; font-size: 1rem; }
.memoir-media-fields section > p { margin: 6px 0 14px; font-size: .78rem; line-height: 1.65; color: var(--memoir-muted); }
.memoir-file-button { display: inline-flex; justify-content: center; align-items: center; text-align: center; cursor: pointer; position: relative; border: 1px solid #b3c2af; border-radius: 10px; padding: 10px 14px; color: #244d32; background: #f5f8f1; font-weight: 700 !important; font-size: .87rem !important; max-width: 100%; overflow: hidden; }
.memoir-file-button input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.memoir-file-button:has(input:disabled) { opacity: .5; cursor: default; }
.memoir-audio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.memoir-audio-actions button { font-size: .85rem; }
.memoir-media-fields .memoir-file-status { margin: 12px 0 0; overflow-wrap: anywhere; }
.memoir .text-button { padding: 10px 8px; border: 0; background: transparent; color: #5e6b60; text-decoration: underline; font-size: .8rem; }
.memoir-save-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0 38px; }
.memoir-save-row > p { font-size: .79rem; line-height: 1.6; color: var(--memoir-muted); }
.memoir-save-row > button { padding: 14px 23px; min-height: 54px; }
.memoir-empty { padding: 38px 20px; text-align: center; background: var(--memoir-paper); border-radius: 15px; margin: 20px 0 28px; }
.memoir-empty > span { display: block; font: 2rem Georgia, serif; color: #899983; margin-bottom: 12px; }
.memoir-empty h2 { font-size: 1.3rem; margin: 0 0 12px; }
.memoir-empty p { color: var(--memoir-muted); font-size: .9rem; line-height: 1.8; margin: 0; }
.memoir-contents { border-top: 1px solid var(--memoir-line); padding-top: 8px; }
.memoir-contents > ol { list-style: none; margin: 0; padding: 0; }
.memoir-contents > ol > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 15px; padding: 22px 0; border-bottom: 1px solid var(--memoir-line); }
.memoir-list-number { font: 1.5rem Georgia, serif; color: #6f8e72; padding-top: 3px; }
.memoir-contents li h3 { font-size: 1.15rem; margin: 0 0 10px; line-height: 1.6; }
.memoir-contents li p { font-size: .9rem; color: var(--memoir-muted); line-height: 1.8; margin: 0 0 10px; white-space: pre-wrap; }
.memoir-contents li small { font-size: .73rem; color: #6c7668; }
.memoir-list-actions { display: flex; gap: 12px; margin-top: 12px; }
.memoir-list-actions > button { font-size: .85rem; }
.memoir-tools { margin: 28px 0 20px; border: 1px solid var(--memoir-line); border-radius: 14px; }
.memoir-tools > p { margin: 0 18px 16px; font-size: .85rem; line-height: 1.75; color: var(--memoir-muted); }
.memoir-tool-buttons { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 18px; }
.memoir-tool-buttons > button { font-size: .85rem; }
.memoir-tools .memoir-limit-note { font-size: .75rem; }
.memoir-loading { padding: 28px 18px; background: #f2f6ed; border-radius: 12px; line-height: 1.8; }
.memoir .memoir-error { color: #8c3329; font-size: .85rem; }
.memoir-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.memoir-book { background: #fffdf7; border: 1px solid #dedfce; padding: 28px; margin: 20px 0; color: #28372c; border-radius: 4px; }
.memoir-book-cover { text-align: center; padding: 55px 10px 65px; border-bottom: 1px solid #d2d8c7; }
.memoir-book-cover h1 { font-family: Georgia, 'Batang', serif; font-size: 2rem; line-height: 1.6; margin: 24px 0; }
.memoir-book-cover p { font-size: .86rem; line-height: 1.75; color: #627259; }
.memoir-book-cover small { font-size: .75rem; display: block; margin-top: 30px; }
.memoir-book-chapter { padding: 35px 0; border-bottom: 1px solid #d9dece; }
.memoir-book-chapter:last-child { border: 0; }
.memoir-chapter-number { font-size: .75rem; letter-spacing: .12em; color: #687c5e; }
.memoir-book-chapter h2 { font-family: Georgia, 'Batang', serif; font-size: 1.6rem; line-height: 1.65; margin: 10px 0 22px; }
.memoir-book-date { font-size: .8rem; color: #697965; }
.memoir-book-chapter > img { display: block; width: 100%; height: auto; max-height: 580px; object-fit: contain; margin: 22px 0 30px; }
.memoir-book-body { font-family: Georgia, 'Batang', serif; font-size: 1rem; line-height: 2; overflow-wrap: anywhere; }
.memoir-book-body p { margin: 0 0 .65em; white-space: pre-wrap; }
.memoir-book-audio { padding: 15px; background: #eef2e8; border-radius: 8px; margin-top: 24px; }
.memoir-book-audio > p { font-size: .85rem; margin-top: 0; }
.memoir-book-audio audio { width: 100%; min-width: 0; }
.memoir-print-sheet { display: none; }
@media (max-width: 420px) {
  .memoir-home { grid-template-columns: minmax(0, 1fr) 80px; padding: 22px 18px !important; gap: 10px; }
  .memoir-cover-symbol { width: 76px; height: 124px; padding: 13px 9px; }
  .memoir-cover-symbol > span { font-size: 1.1rem; }
  .memoir-cover-symbol small { font-size: .5rem; }
  .memoir-home h2 { font-size: 1.45rem; }
  .memoir-home-copy > p:not(.eyebrow) { font-size: .84rem; }
  .memoir-link-button { font-size: .85rem !important; padding: 12px; gap: 9px; }
  .memoir-volume { font-size: 2.6rem; }
  .memoir-question-grid { grid-template-columns: 1fr; }
  .memoir-media-fields { grid-template-columns: 1fr; }
  .memoir-media-fields > section + section { border-left: 0; border-top: 1px solid var(--memoir-line); }
  .memoir-section-heading { align-items: flex-start; flex-direction: column; }
  .memoir-save-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .memoir-save-row > p { margin: 4px 0 10px; }
  .memoir-book { padding: 18px; }
}
@media print {
  @page { size: A4; margin: 20mm 18mm; }
  body[data-memoir-print] { background: #fff !important; }
  body[data-memoir-print] > *:not(.memoir-print-sheet) { display: none !important; }
  body[data-memoir-print] > .memoir-print-sheet { display: block !important; width: 100%; }
  .memoir-print-sheet .memoir-book { border: 0; padding: 0; margin: 0; background: white; }
  .memoir-print-sheet .memoir-book-cover { break-after: page; border: 0; min-height: 180mm; padding-top: 45mm; }
  .memoir-print-sheet .memoir-book-cover h1 { font-size: 30pt; }
  .memoir-print-sheet .memoir-book-chapter { break-before: page; border: 0; padding: 0; }
  .memoir-print-sheet .memoir-book-chapter h2 { font-size: 22pt; break-after: avoid; }
  .memoir-print-sheet .memoir-book-body { font-size: 12pt; line-height: 1.9; }
  .memoir-print-sheet .memoir-book-body p { orphans: 3; widows: 3; }
  .memoir-print-sheet img { max-height: 120mm; break-inside: avoid; }
  .memoir-print-audio-note { font-size: 9pt; color: #555; margin-top: 12mm; }
}
