/* Memory is a coherent dossier, sharing the portrait's paper and forest palette. */
.memory-library-head{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:3px 0 25px;padding-bottom:24px;border-bottom:1px solid #d2d8cb}
.memory-library-head h1{font-family:"Songti SC",STSong,serif;font-size:31px;line-height:1.5;font-weight:600;color:#204e3b;margin:0}
.memory-library-count{display:flex;align-items:baseline;gap:7px;color:#546453;font-size:14px;white-space:nowrap}
.memory-library-count b{font-family:Georgia,serif;font-size:29px;font-weight:400;color:#275b43}
.memory-library-count i{display:block;height:16px;width:1px;background:#c3cdbd;margin:0 13px}
.memory-library-tools{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.memory-library-search{display:flex;align-items:center;gap:12px;border-bottom:1px solid #9caa95;max-width:380px;width:100%;padding:10px 2px;color:#45634b}
.memory-library-search svg{height:19px;width:19px;flex:0 0 19px}
.memory-library-search input{width:100%;border:0;background:transparent;font-size:15px;outline:none;color:#293f2c}
.memory-library-search input::placeholder{color:#67755e}
.memory-topic-nav{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:22px 0 24px}
.memory-topic-nav button{display:flex;align-items:center;gap:7px;padding:9px 13px;border:1px solid transparent;border-radius:5px;background:transparent;font-size:14px;line-height:1.5;color:#4b634d}
.memory-topic-nav button:hover{background:#e5eadd}
.memory-topic-nav button.active{background:#285b43;color:#fffdf3;border-color:#285b43}
.memory-topic-nav button span{font-size:12px;opacity:.8;font-variant-numeric:tabular-nums}
.memory-topic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;align-items:stretch}
.memory-topic-grid.expanded{grid-template-columns:minmax(0,1fr)}
.memory-topic-card{display:flex;flex-direction:column;min-width:0;background:#fffdf6;border:1px solid #d5dacb;border-radius:8px;overflow:hidden}
.memory-topic-card>header{display:flex;align-items:center;gap:12px;padding:24px 25px 19px;border-bottom:1px solid #e1e4d7}
.memory-topic-icon{display:flex;align-items:center;justify-content:center;width:35px;height:35px;background:#e9eedf;color:#326448;border-radius:7px}
.memory-topic-icon svg{height:22px;width:22px}
.memory-topic-card h2{font-size:20px;font-weight:600;line-height:1.5;margin:0;color:#294e36}
.memory-topic-count{margin-left:auto;font-family:Georgia,serif;font-size:23px;color:#758367}
.memory-topic-content{padding:3px 25px 0;flex:1}
.memory-note{position:relative;display:block;width:100%;text-align:left;padding:18px 25px 18px 0;border:0;border-bottom:1px solid #e4e7db;background:transparent;line-height:1.8;color:#304c34;overflow-wrap:anywhere}
.memory-note:last-child{border-bottom:0}
.memory-note:hover .memory-note-text{color:#14613f}
.memory-note:focus-visible,.memory-portrait-topic:focus-visible,.memory-topic-open:focus-visible{outline:2px solid #326b4c;outline-offset:-2px;border-radius:3px}
.memory-note-top{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:3px}
.memory-note-top:empty{display:none}
.memory-note-top b{font-size:13px;line-height:1.6;font-weight:600;color:#5d7057}
.memory-note-text{display:block;font-size:16px;line-height:1.85;color:#2d422c}
.memory-note-arrow{position:absolute;right:0;top:21px;font-size:17px;color:#7b8e6c}
.memory-note time{display:block;font-size:13px;color:#63755b;margin-top:5px}
.memory-event-note{padding-left:16px}
.memory-event-note:before{content:"";position:absolute;width:5px;height:5px;background:#a28d59;left:0;top:29px;border-radius:50%}
.memory-lifecycle{display:inline-flex;font-size:12px;line-height:1.5;padding:2px 7px;background:#e8eedf;color:#426541;border-radius:3px;white-space:nowrap}
.memory-lifecycle.cancelled{background:#ede8df;color:#7b6956}
.memory-topic-open{display:flex;align-items:center;justify-content:space-between;gap:15px;width:100%;padding:16px 25px;border:0;border-top:1px solid #e0e4d5;color:#356443;background:#f7f7ee;font-size:14px;text-align:left}
.memory-topic-open:hover{background:#eef2e5}
.memory-topic-grid.expanded .memory-fact-notes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:38px}
.memory-topic-grid.expanded .memory-note{border-bottom:1px solid #e4e7db}
.memory-empty{padding:58px 24px;text-align:center;border:1px solid #d4dccb;border-radius:8px;background:#fffdf6}
.memory-empty h2{font-size:21px;color:#35543b;font-weight:500;margin:0 0 12px}
.memory-empty p{font-size:15px;line-height:1.8;color:#61735a;margin:0 0 16px}
.memory-portrait-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0}
.memory-portrait-topic{min-width:0;border:0;border-top:1px solid #dce1d1;background:transparent;text-align:left;padding:20px 20px 23px;min-height:138px}
.memory-portrait-topic:nth-child(4n+1){padding-left:0}
.memory-portrait-topic:hover{background:#f4f5eb}
.memory-portrait-label{display:flex;align-items:center;gap:9px;color:#3d6040;margin-bottom:11px}
.memory-portrait-label svg{height:19px;width:19px;flex:0 0 19px}
.memory-portrait-label b{font-size:15px;font-weight:600}
.memory-portrait-label>span{margin-left:auto;color:#6f825f}
.memory-portrait-copy{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:14px;line-height:1.85;color:#3f5338;overflow-wrap:anywhere}
.memory-entry-modal .modal-card{position:relative;max-width:620px;background:#fffdf6;border:1px solid #d3dbca;border-radius:10px;padding:33px;max-height:85dvh;overflow:auto}
.memory-entry-modal h2{font-size:23px;font-weight:600;color:#31543b;line-height:1.6;margin:0 35px 22px 0}
.memory-entry-statement{font-size:20px;line-height:1.9;color:#28452e;margin:0 0 25px;overflow-wrap:anywhere;white-space:pre-wrap}
.memory-entry-sources{margin-top:26px;border-top:1px solid #d8dfcc;padding-top:22px}
.memory-entry-sources h3{font-size:15px;color:#546b4b;line-height:1.5;font-weight:600;margin:0 0 17px}
.memory-entry-sources blockquote{margin:12px 0;padding:14px 18px;border-left:2px solid #a4b394;background:#f0f3e8;font-size:15px;line-height:1.9;color:#3b5036;white-space:pre-wrap;overflow-wrap:anywhere}
.memory-entry-sources footer{font-size:13px;color:#637658;margin-top:9px}
.memory-entry-actions{display:flex;justify-content:space-between;align-items:center;gap:20px;padding-top:27px;margin-top:25px;border-top:1px solid #d8dfcc}
.memory-remove-link{font-size:14px;border:0;background:none;color:#8a5a48;padding:5px 0}
.memory-loading{font-size:14px;line-height:1.8;color:#69765d}
@media(min-width:1450px){.memory-topic-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1100px){.memory-portrait-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.memory-portrait-topic:nth-child(2n+1){padding-left:0}}
@media(max-width:680px){.memory-library-head{align-items:flex-start;gap:12px;flex-direction:column;margin-bottom:17px;padding-bottom:18px}.memory-library-head h1{font-size:27px}.memory-library-count b{font-size:23px}.memory-topic-nav{flex-wrap:nowrap;overflow-x:auto;margin:17px 0;gap:4px;padding-bottom:5px}.memory-topic-nav button{flex-shrink:0;padding:8px 10px}.memory-topic-grid{grid-template-columns:1fr;gap:16px}.memory-topic-card>header{padding:19px 20px 15px}.memory-topic-content{padding:2px 20px 0}.memory-topic-open{padding:14px 20px}.memory-topic-grid.expanded .memory-fact-notes{grid-template-columns:1fr}.memory-portrait-topic{padding:17px 12px;min-height:124px}.memory-portrait-label{gap:7px}.memory-portrait-copy{font-size:14px}.memory-entry-modal .modal-card{padding:25px;max-height:88dvh}.memory-entry-statement{font-size:18px}.memory-entry-actions{gap:10px}.memory-note-text{font-size:16px}}

/* Dynamic factual topics: narrative first, individual records on demand. */
.memory-topic-card>header{align-items:flex-start}
.memory-topic-card h2{overflow-wrap:anywhere;flex:1}
.memory-topic-count{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2;flex:0 0 auto}
.memory-topic-count small{font-family:inherit;font-size:12px;color:#586951;margin-top:5px}
.memory-topic-content{padding-top:0;padding-bottom:22px}
.memory-narrative{padding-top:20px}
.memory-narrative-part+ .memory-narrative-part{margin-top:18px}
.memory-narrative-part p{font-size:17px;line-height:1.95;color:#2c4330;margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.memory-topic-detail .memory-narrative{max-width:78ch}
.memory-topic-detail .memory-narrative-part p{font-size:18px}
.memory-topic-card:not(.memory-topic-detail) .memory-narrative-part p,.memory-note-text,.memory-long-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}
.memory-long-text>summary{cursor:pointer;list-style:none;color:#366443;font-size:14px;line-height:1.9}
.memory-long-preview{font-size:18px;line-height:1.95;color:#2c4330;overflow-wrap:anywhere;margin-bottom:8px;white-space:pre-wrap}
.memory-long-close,.memory-long-text[open] .memory-long-preview,.memory-long-text[open] .memory-long-open{display:none}
.memory-long-text[open] .memory-long-close{display:inline}
.memory-long-text[open]>summary{margin-bottom:9px}
.memory-long-text>summary:focus-visible{outline:2px solid #326b4c;outline-offset:3px}
.memory-citations{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}
.memory-citation{font-size:13px;color:#366443;background:#eff2e7;border:1px solid #d9e1cd;border-radius:4px;padding:4px 9px;line-height:1.65}
.memory-citation:hover{background:#e2e9d8}
.memory-changes{margin-top:22px;padding:17px 18px;background:#f1f1e6;border-left:2px solid #9a8855}
.memory-changes h3{font-size:14px;line-height:1.6;margin:0 0 9px;color:#685b3d;font-weight:600}
.memory-change+ .memory-change{border-top:1px solid #dce0cf;margin-top:14px;padding-top:14px}
.memory-change p{font-size:15px;line-height:1.85;color:#48543b;margin:0 0 5px;overflow-wrap:anywhere}
.memory-change time{font-size:13px;line-height:1.7;color:#59634d;margin-right:12px}
.memory-facts-disclosure{margin-top:26px;border-top:1px solid #dce1d0;padding-top:18px}
.memory-facts-disclosure>summary{cursor:pointer;font-size:15px;line-height:1.8;color:#3b5a40;list-style-position:inside}
.memory-facts-disclosure>summary span{font-variant-numeric:tabular-nums;margin-left:7px;color:#596b50}
.memory-back{font-size:14px;color:#365c3e;background:none;border:0;padding:0;margin:0 0 18px;line-height:1.8}
.memory-text-link{border:0;background:none;font-size:14px;color:#326547;padding:0;line-height:1.7}
.memory-citation:focus-visible,.memory-back:focus-visible,.memory-facts-disclosure>summary:focus-visible{outline:2px solid #326b4c;outline-offset:3px}
.memory-portrait-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
.memory-portrait-topic{padding-left:0;padding-right:24px}
.memory-portrait-copy{font-size:15px;color:#344c35}
@media(max-width:680px){.memory-topic-detail .memory-narrative-part p,.memory-long-preview{font-size:17px}.memory-narrative-part p{font-size:16px}.memory-topic-content{padding-bottom:20px}.memory-changes{padding:14px}.memory-portrait-grid{grid-template-columns:1fr}.memory-portrait-topic{min-height:0;padding:17px 0}.memory-portrait-copy{-webkit-line-clamp:3}.memory-citation{min-height:36px;padding:6px 10px}.memory-facts-disclosure>summary{min-height:36px}}

.memory-citation-group>summary{font-size:14px;line-height:1.8;color:#3e6446;cursor:pointer;list-style-position:inside}.memory-citation-group{width:100%}.memory-citation-group .memory-citations{margin-top:10px}.memory-citation-group>summary:focus-visible{outline:2px solid #326b4c;outline-offset:3px}
