:root{font-family:system-ui,sans-serif;color:#f5e6cd;background:#180b09;font-size:16px}*{box-sizing:border-box}body{margin:0;padding-bottom:94px;background:radial-gradient(circle at top,#3b1914,#180b09 75%);min-height:100vh}header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px;border-bottom:1px solid #785b42}.brand{display:flex;flex-direction:column;letter-spacing:.18em;font-size:.68rem}.brand strong{font-family:Georgia,serif;font-size:3.5rem;line-height:1;color:#d8b27e}.brand span{margin-top:8px}h1,h2,h3{font-family:Georgia,serif;color:#f7e7cf}h1{font-size:2.2rem}main{max-width:1050px;margin:auto;padding:22px}button,input,select,textarea{font:inherit}button{cursor:pointer;background:#62443a;color:#fff1dc;border:1px solid #a48264;border-radius:12px;padding:12px;min-height:44px}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #d5ae6c}button[aria-current="page"]{background:#9a6b43;color:white}input,textarea,select{width:100%;padding:12px;border-radius:10px;border:1px solid #9c795d;background:#261813;color:#fff2e2;margin:6px 0 14px}textarea{min-height:110px}label{display:block;font-weight:600;margin-top:10px}nav{position:fixed;bottom:0;left:0;right:0;display:flex;overflow-x:auto;background:#200e0c;border-top:1px solid #886d53;padding:8px;gap:5px;z-index:5}nav button{flex:1;min-width:76px;font-size:.8rem;padding:9px 5px}#status{padding:9px 20px;background:#4d2c1d;color:#f6e0c0;font-size:.88rem}#status:empty{display:none}.panel{background:#321b16;border:1px solid #7d5a43;border-radius:15px;padding:18px;margin:14px 0}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.grid button{text-align:left}.muted{color:#d0b9a7}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:11px;vertical-align:top}thead{background:#684634}tbody tr:nth-child(odd){background:#f2e2c9;color:#2b1a14}tbody tr:nth-child(even){background:#634236;color:#fff0df}tbody tr button{padding:6px;min-height:35px}.inline{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.inline>*{flex:1}.small{font-size:.85rem}.danger{border-color:#cc866f}a{color:#e7c68f}details{margin:10px 0}summary{cursor:pointer}.result{padding:12px;border-bottom:1px solid #785b42}#results{max-height:60vh;overflow:auto}@media(min-width:780px){main{padding:30px}nav{max-width:1000px;left:50%;transform:translateX(-50%);border-radius:15px 15px 0 0}}

/* Research library upgrade */
.research-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.research-tiles button{text-align:left;background:#4b3024}.research-tiles span,.index-entry span{display:block;font-size:.82rem;color:#ead0ad;margin-top:5px}.index-entry{display:block;width:100%;text-align:left;margin:6px 0;background:#36231d}.profile-subtitle{font-size:1.12rem;color:#edc48e}.chips{display:flex;gap:8px;flex-wrap:wrap}.chip{min-height:38px;padding:7px 12px;border-radius:30px;background:#6c4b36}#results{max-height:none}section.panel p{line-height:1.65}tbody th{min-width:125px;text-align:left;padding:11px}tbody tr:nth-child(odd) th{color:#2b1a14}tbody tr:nth-child(even) th{color:#fff0df}@media(max-width:520px){main{padding:16px}.panel{padding:14px}h1{font-size:2rem}}

.online-card{padding:1rem;margin:.75rem 0;border:1px solid #9d785a;border-radius:12px;background:#281b17}.online-card p{line-height:1.6}.research-links{line-height:2}.research-links a,.online-card a{color:#f2c891;text-decoration:underline}

/* v4: focused mobile interface */
header{padding:13px 20px}.brand strong{font-size:2.7rem}.brand span{font-size:.62rem}#status{display:none}main{padding-top:14px}h1{font-size:2rem;margin:18px 0}h2{font-size:1.35rem}.home-head{padding:10px 2px 18px}.home-head h1{font-size:4rem;margin:0;line-height:1.1}.eyebrow{letter-spacing:.22em;font-size:.67rem;color:#d5b68c}.home-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.home-actions button{min-height:130px;padding:18px;background:linear-gradient(145deg,#503023,#302019);text-align:left;display:flex;flex-direction:column;justify-content:space-between;border-color:#927050}.home-actions strong{font:1.55rem Georgia,serif}.home-actions span{font-size:.82rem;color:#e0c8a7}.recent{margin-top:24px}nav{justify-content:space-between;gap:3px}nav button{min-width:65px;font-size:.78rem;padding:10px 5px}.search-panel{padding:16px}.search-line{display:flex;gap:8px;align-items:center}.search-line input{min-width:0;flex:1;margin:4px 0}.search-line button{white-space:nowrap}.source-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.source-tile{display:flex;flex-direction:column;justify-content:space-between;gap:8px;background:#473026;border:1px solid #866449;border-radius:12px;padding:14px;text-decoration:none;min-height:115px}.source-tile span{color:#d8b58d;font-size:.7rem}.source-tile strong{font:1.08rem Georgia,serif;color:#fff0d8}.source-tile small{font-size:.72rem;color:#e7c68f}.source-heading h2{margin-bottom:0}.wiki-results{margin-top:18px}.wiki-results summary{font-weight:600}.choice-row{display:flex;gap:8px}.choice-row button{flex:1}details.panel>summary{font-weight:600;font-size:1.08rem;min-height:32px}details.panel[open]>summary{margin-bottom:16px}@media(max-width:370px){.search-line{flex-direction:column;align-items:stretch}.home-actions button{min-height:115px;padding:13px}.source-grid{grid-template-columns:1fr}}

/* v4.1: compact research controls and optional sourced preview */
.research-filter{display:flex;gap:6px;overflow-x:auto;white-space:nowrap;padding:10px 0 12px;scrollbar-width:thin}.filter-pill{flex:0 0 auto;min-height:32px;padding:5px 11px;border-radius:999px;font-size:.78rem;background:#34231d;border:1px solid #785945}.filter-pill[aria-pressed="true"]{background:#b48b5e;color:#21140e;border-color:#d4b38b;font-weight:700}.compact-sources{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.compact-sources .source-tile{min-height:66px;padding:10px 12px;gap:4px;border-radius:9px}.compact-sources .source-tile strong{font: .92rem system-ui,sans-serif;font-weight:650}.compact-sources .source-tile span{font-size:.67rem}.source-disclaimer{font-size:.75rem;color:#cfb49c;line-height:1.4;margin:12px 0}.mini-profile{display:flex;gap:14px;padding:13px;background:linear-gradient(120deg,#493026,#2c1b16);border:1px solid #9a7553;border-radius:13px;margin:16px 0 6px;align-items:flex-start}.mini-image{width:98px;max-height:150px;object-fit:cover;border-radius:8px;flex-shrink:0}.mini-content{min-width:0;flex:1}.mini-content h2{margin:5px 0 8px;font-size:1.35rem}.mini-content p{font-size:.87rem;line-height:1.5;margin:0 0 10px;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}.mini-kicker{font-size:.61rem;letter-spacing:.08em;color:#e0ba8a}.mini-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.mini-actions a{font-size:.84rem}.mini-actions button{font-size:.8rem;min-height:34px;padding:6px 10px}@media(max-width:370px){.mini-image{width:75px}.mini-profile{gap:9px;padding:10px}}

/* v4.2: compact source destinations without duplicate large tiles */
.research-filter{gap:10px;padding:14px 2px 17px;margin-top:5px}.filter-pill{padding:7px 14px;min-height:36px}.source-list{display:flex;flex-wrap:wrap;gap:9px 10px}.source-link{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;border:1px solid #806149;border-radius:12px;background:#36241d;color:#f4dfc3;text-decoration:none;font-size:.85rem;max-width:100%;min-height:40px}.source-link span{font-weight:600}.source-link small{font-size:.65rem;color:#d6b899;white-space:nowrap}.source-link:focus-visible,.filter-pill:focus-visible{outline:2px solid #f3c98b;outline-offset:2px}.source-disclaimer{margin-top:16px}

/* v4.3: compact research, larger overview, no duplicate source lists */
.research-filter{gap:12px;padding:18px 0 20px;margin:0}.filter-pill{min-height:38px;padding:8px 17px}.research-google{display:block;text-align:center;border:1px solid #a47e59;background:#654330;border-radius:12px;padding:14px;color:#fff0d7;text-decoration:none;font-weight:650;margin:0 0 10px}.mini-profile{padding:19px;gap:18px;min-height:220px}.mini-image{width:35%;max-height:280px}.mini-content h2{font-size:1.75rem}.mini-content p{font-size:1rem;line-height:1.65;-webkit-line-clamp:unset;display:block;overflow:visible}.mini-kicker{font-size:.65rem}@media(max-width:420px){.mini-profile{padding:14px;gap:13px}.mini-image{width:34%}.mini-content h2{font-size:1.5rem}}

/* v4.4 — editorial, airy research overview; preserve search and saved behavior */
.mini-profile{display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:0;overflow:hidden;background:linear-gradient(155deg,#4a3026 0%,#301d17 70%,#261612 100%);border:1px solid #ab8662;border-radius:18px;margin:22px 0 16px;box-shadow:0 12px 30px rgba(0,0,0,.16)}
.mini-image{display:block;width:100%;height:220px;max-height:none;object-fit:contain;object-position:center;background:#241713;border-radius:0;border-bottom:1px solid #76513b;padding:10px}
.mini-content{min-width:0;padding:24px 23px 25px}
.mini-kicker{display:block;color:#e1bf94;font-size:.7rem;letter-spacing:.13em;line-height:1.75;font-weight:600;margin:0 0 13px;text-transform:uppercase}
.mini-content h2{font-size:clamp(2rem,7vw,2.6rem);line-height:1.16;letter-spacing:-.025em;margin:0 0 19px;color:#fff1db}
.mini-content p{font-size:1.04rem;line-height:1.95;letter-spacing:.012em;color:#f1dfc9;margin:0 0 26px;display:block;overflow:visible;overflow-wrap:anywhere;max-width:65ch}
.mini-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;border-top:1px solid rgba(219,181,142,.25);padding-top:18px}
.mini-actions a{font-size:.94rem;line-height:1.5;text-underline-offset:4px}
.mini-actions button{font-size:.88rem;min-height:40px;padding:8px 15px;border-radius:10px}
@media(min-width:680px){.mini-profile{grid-template-columns:minmax(190px,34%) minmax(0,1fr)}.mini-image{height:100%;min-height:300px;border-bottom:0;border-right:1px solid #76513b;padding:18px}.mini-content{padding:32px}.mini-content h2{font-size:2.7rem}}
@media(max-width:420px){.mini-profile{padding:0;gap:0}.mini-image{width:100%;height:200px;max-height:none}.mini-content{padding:22px 20px 24px}.mini-content h2{font-size:2.1rem}.mini-content p{font-size:1.02rem;line-height:1.9}.mini-kicker{font-size:.66rem}}

/* v4.5: clean navigation, Montserrat, research controls after overview */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');
:root,body,button,input,select,textarea,h1,h2,h3,.home-actions strong,.source-tile strong{font-family:Montserrat,'Century Gothic',Arial,sans-serif}
.brand strong{font-family:Montserrat,Arial,sans-serif;font-size:2.25rem;letter-spacing:-.08em}.brand{cursor:pointer}.home-head .eyebrow{display:none}.home-head h1{font-family:Montserrat,Arial,sans-serif;font-size:3rem;font-weight:600}.home-actions strong{font-size:1.2rem;font-weight:600}
.mini-content h2{font-family:Montserrat,Arial,sans-serif;font-size:1.85rem;letter-spacing:0;font-weight:600}.mini-content p{font-size:1rem;line-height:1.85}.mini-kicker{font-size:.62rem}
.research-filter{gap:9px;overflow-x:auto}.filter-pill{font-size:.78rem}.research-google{margin-top:10px}.search-line{flex-direction:column;align-items:stretch}.search-line button{width:100%}
nav{justify-content:space-around}nav button{flex:1;min-width:0;font-size:.72rem;padding:10px 2px}.category-heading{display:flex;align-items:center;justify-content:space-between}.plus-action{font-size:1.8rem;min-width:54px}.category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.category-tile{min-height:135px;display:flex;flex-direction:column;justify-content:space-between;text-align:left;padding:18px;background:linear-gradient(145deg,#51362a,#2b1a16)}.category-tile strong{font-size:1.05rem}.category-tile span{font-size:.78rem;color:#d9bc9d}.category-entry{padding:20px;background:#36221b;border:1px solid #89654d;border-radius:16px;margin:16px 0}.category-entry h2{margin:0 0 16px}.category-entry p{white-space:pre-wrap;line-height:1.7}.category-photo{width:100%;max-height:400px;object-fit:contain;border-radius:12px;margin-bottom:12px}.category-entry textarea{margin-top:16px}.text-back{background:transparent;border:0;padding:8px 0}.category-items{padding-bottom:20px}

/* v4.6 compact category and item menus */
.category-tile{position:relative;padding:0;min-height:135px;display:block}
.category-open{width:100%;height:100%;min-height:135px;padding:18px 54px 18px 18px;text-align:left;display:flex;flex-direction:column;justify-content:space-between;border:0;background:transparent;color:inherit}
.category-open strong{font-size:1.05rem}.category-open span{font-size:.78rem;color:#d9bc9d}
.item-menu{position:relative;z-index:2}.category-tile>.item-menu{position:absolute;right:8px;top:8px}
.item-menu>summary{list-style:none;cursor:pointer;border:1px solid #89654d;border-radius:12px;padding:2px 10px;font-size:1.6rem;line-height:1.4;color:#f1dcc5;background:#493025;min-width:42px;text-align:center}
.item-menu>summary::-webkit-details-marker{display:none}.item-menu[open]{z-index:5}
.menu-actions{position:absolute;right:0;top:100%;z-index:20;width:185px;padding:7px;background:#39251d;border:1px solid #b18a6a;border-radius:12px;box-shadow:0 10px 30px #0009;display:flex;flex-direction:column;gap:4px}
.menu-actions button{display:block;text-align:left;width:100%;padding:10px;font-size:.9rem;min-height:42px}
.entry-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.entry-head h2{margin:0 0 12px;min-width:0;overflow-wrap:anywhere}
.category-grid,.category-items{overflow:visible}

/* v4.7: minimal home, four-tab navigation and compact header actions */
header{display:flex;align-items:center;justify-content:space-between;gap:8px} .header-actions{display:flex;gap:5px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.header-actions button{font-size:.75rem;padding:9px 8px;min-height:40px;border-radius:10px}nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}nav button{min-width:0;padding:12px 3px;font-size:clamp(.75rem,3.1vw,1rem)}.home-simple{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding-top:25px}.home-square{min-height:190px;aspect-ratio:1/1;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;text-align:left;padding:22px 16px;background:#493025;border:1px solid #a77f5d;border-radius:19px;color:#f8e8d7}.home-square strong{font-size:clamp(1.25rem,5vw,2rem);line-height:1.2}.home-square span{font-size:.86rem;color:#d9bfa8}.home-square .home-plus{font-size:3.7rem;font-weight:400}.brand{cursor:pointer}
:root[data-theme="light"]{color-scheme:light}html[data-theme="light"] body{background:#f3e8da;color:#37231c}html[data-theme="light"] header,html[data-theme="light"] nav{background:#e7d5c1;color:#37231c}html[data-theme="light"] main{color:#37231c}html[data-theme="light"] .panel,html[data-theme="light"] .category-entry,html[data-theme="light"] .category-tile,html[data-theme="light"] .home-square{background:#fff8f0;color:#37231c}html[data-theme="light"] button,html[data-theme="light"] input,html[data-theme="light"] textarea,html[data-theme="light"] select{color:#37231c;background:#e8d6c4}html[data-theme="light"] .home-square span{color:#6e5140}html[data-theme="light"] .menu-actions{background:#fff8f0}html[data-theme="light"] .menu-actions button{color:#37231c}html[data-theme="light"] .muted{color:#6e5140}

/* v4.8: categories themselves are the home screen; no duplicate logo */
.home-simple{padding-top:18px;align-content:start}.home-create{justify-content:center;align-items:center}.home-create .home-plus{font-size:4rem;line-height:1}.home-square{min-width:0;overflow-wrap:anywhere}.home-square strong{font-family:Montserrat,Arial,sans-serif;font-weight:600}.brand strong{font-size:2rem}.category-grid{margin-top:12px}

/* v4.9 — Samsung-first minimal home: no counters, no duplicate visual hierarchy */
.home-simple{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:22px 18px 112px;align-content:start}
.home-square{min-height:0;aspect-ratio:1/1;padding:18px;justify-content:flex-start;box-shadow:0 6px 18px rgba(0,0,0,.12);border-radius:16px;background:linear-gradient(145deg,#51392d 0%,#39251e 100%);transition:background .15s ease}
.home-square strong{font-size:clamp(.98rem,4.3vw,1.3rem);line-height:1.4;overflow-wrap:anywhere}
.home-create{justify-content:center;align-items:center}.home-create .home-plus{font-size:3.3rem;font-weight:400;line-height:1}
header{padding:13px 17px;min-height:72px}.brand strong{font-size:1.9rem;line-height:1}
.header-actions{gap:7px;flex-wrap:nowrap}.header-actions button{display:grid;place-items:center;min-width:39px;width:39px;height:39px;min-height:39px;padding:0;border-radius:12px;font-size:1.25rem;line-height:1}
nav{position:fixed;bottom:0;left:0;right:0;z-index:30;padding:9px max(9px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom));gap:7px;grid-template-columns:repeat(4,minmax(0,1fr));box-shadow:0 -8px 22px #10080544}
nav button{font-size:clamp(.72rem,2.9vw,.95rem);padding:12px 2px;min-height:47px;border-radius:12px}
main{padding-bottom:calc(100px + env(safe-area-inset-bottom))}
@media(max-width:370px){.home-simple{gap:12px;padding-left:12px;padding-right:12px}.home-square{padding:13px}.header-actions button{min-width:35px;width:35px;height:35px}}
html[data-theme="light"] .home-square{background:linear-gradient(145deg,#fff9f2,#ebd8c5)}

/* v5.0: refined controls and research flow */
.header-actions{gap:9px}.header-actions button{border-radius:50%;width:40px;height:40px;min-width:40px;background:#483027;border:1px solid #896a53;box-shadow:none}.header-actions button svg{width:19px;height:19px;display:block}.header-actions button:focus-visible{outline:2px solid #e6c49b;outline-offset:3px}
.research-filter{margin:14px 0 9px;padding:3px 0 12px;gap:9px}.research-google{margin:0 0 18px;min-height:48px;display:flex;align-items:center;justify-content:center}.mini-profile{margin:0 0 6px}.search-panel #onlineResults{display:flex;flex-direction:column}.search-panel .mini-content p{line-height:1.85}.search-panel .mini-content h2{margin:16px 0}.search-panel .mini-kicker{letter-spacing:.12em}
html[data-theme="light"] .header-actions button{background:#e8d6c4;color:#37231c}

/* v5.1: compact, consistent header controls */
header{padding:12px 20px;min-height:70px}
.header-actions{gap:10px;flex-wrap:nowrap}
.header-actions button{display:grid;place-items:center;flex:0 0 38px;width:38px;min-width:38px;height:38px;min-height:38px;padding:0;border-radius:50%;background:#3b251f;border:1px solid #765846;color:#eedbc5;box-shadow:none;font-size:0}
.header-actions button svg{display:block;width:18px;height:18px;stroke:currentColor}
.header-actions button:active{background:#644435}
html[data-theme="light"] .header-actions button{background:#e9d8c7;border-color:#a68c72;color:#3a251c}
@media(max-width:370px){header{padding:12px 14px}.header-actions{gap:7px}.header-actions button{flex-basis:36px;width:36px;min-width:36px;height:36px;min-height:36px}}

/* v5.2 — home grid and mobile touch polish */
.home-simple{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:20px 16px 112px}
.home-square{aspect-ratio:1/1;min-height:0;border-radius:18px;padding:18px;background:linear-gradient(150deg,#51392d,#35221c);border:1px solid #997454;box-shadow:0 7px 20px #10080525;transition:transform .15s ease,border-color .15s ease}
.home-square strong{font-size:clamp(1rem,4.5vw,1.3rem);font-weight:600;letter-spacing:-.02em;line-height:1.35}
.home-square:active{transform:scale(.98)}
.home-create{justify-content:center;align-items:center}
.home-create .home-plus{font-size:3.1rem;font-weight:300}
.header-actions button{border-radius:50%;width:36px;height:36px;min-width:36px;min-height:36px;flex-basis:36px}
.header-actions button svg{width:17px;height:17px}
header{min-height:66px;padding:11px 18px}
nav{gap:8px;padding:8px 12px calc(8px + env(safe-area-inset-bottom))}
nav button{border-radius:14px;min-height:49px}
.home-square:focus-visible,.header-actions button:focus-visible,nav button:focus-visible{outline:2px solid #e6c49b;outline-offset:3px}
@media(max-width:380px){.home-simple{gap:12px;padding:18px 12px 100px}.home-square{padding:14px}.header-actions{gap:7px}}
html[data-theme="light"] .home-square{background:linear-gradient(150deg,#fff9f1,#ead7c4);border-color:#c4a589}

/* v5.3 — Research reading comfort, no changes to saved data or search logic */
.search-panel{padding:clamp(14px,4vw,22px)}
.search-panel .mini-profile{margin-top:16px;margin-bottom:8px;box-shadow:0 8px 24px #0002}
.search-panel .mini-image{height:clamp(150px,38vw,215px);padding:12px;object-fit:contain}
.search-panel .mini-content{padding:clamp(20px,5vw,30px)}
.search-panel .mini-kicker{font-size:.67rem;line-height:1.6;letter-spacing:.095em;margin-bottom:18px}
.search-panel .mini-content h2{font-size:clamp(1.75rem,7vw,2.35rem);line-height:1.23;margin:0 0 24px;font-weight:650}
.search-panel .mini-content p{font-size:clamp(.98rem,3.9vw,1.08rem);line-height:1.85;letter-spacing:.005em;max-width:54ch;margin:0 0 28px;overflow-wrap:break-word}
.search-panel .mini-actions{padding-top:20px;gap:12px}
.search-panel .research-filter{margin:13px 0 8px;padding-bottom:9px}
.search-panel .research-google{margin-bottom:16px}
@media(min-width:680px){.search-panel .mini-image{height:100%;min-height:260px}.search-panel .mini-content{padding:32px}}

/* v5.4: optional expanded reading view */
.search-panel .overview-extract:not(.expanded){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}
.search-panel .overview-extract{line-height:1.8;overflow-wrap:anywhere;margin-bottom:12px}
.search-panel .overview-toggle{display:inline-flex;width:auto;min-height:42px;padding:8px 12px;margin:0 0 14px;background:transparent;color:#e8c49f;border:1px solid #937056;border-radius:10px;font-size:.9rem;font-weight:600}
html[data-theme="light"] .search-panel .overview-toggle{color:#513527;border-color:#94745c}
@media(max-width:440px){.search-panel .mini-content{padding:20px}.search-panel .mini-content h2{margin:0 0 16px}.search-panel .mini-image{height:190px}}

/* v5.7 visible category editing improvements */
.note-state{display:block;font-size:.75rem;opacity:.8;margin-top:6px}
.photo-open{display:block;width:100%;padding:0;background:transparent;border:0;text-align:left;cursor:zoom-in}
.photo-open .category-photo{display:block;width:100%;height:auto;max-height:320px;object-fit:contain}
.photo-open span{display:block;text-align:right;font-size:.78rem;padding:5px 0 10px;opacity:.8}
.photo-dialog{position:fixed;inset:12px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);width:100%;padding:14px;border:1px solid #b89b76;border-radius:14px;background:#261a15;color:#f4e9db;box-shadow:0 0 0 100vmax #0009}
.photo-dialog::backdrop{background:#000b}
.photo-dialog img{display:block;width:100%;max-height:calc(100dvh - 100px);object-fit:contain}
.photo-close{display:block;margin:0 0 12px auto;width:auto;padding:9px 14px}

/* v6.0: six chambers */
.brand strong{font-size:1.15rem;letter-spacing:.025em;white-space:nowrap}
nav{display:flex;overflow-x:auto;gap:6px;scrollbar-width:thin;justify-content:flex-start}
nav button{flex:0 0 auto;min-width:94px;max-width:140px;font-size:.72rem;padding:9px 8px;white-space:normal;line-height:1.25}
.canvas-toolbar{display:flex;gap:6px;flex-wrap:wrap;position:sticky;top:0;z-index:4;padding:9px 0;background:var(--bg,#241914)}
.canvas-toolbar button{width:auto;min-height:38px;padding:6px 12px;border-radius:9px}
.vault-canvas{min-height:50vh;border:1px solid #957452;border-radius:14px;padding:clamp(18px,5vw,34px);line-height:1.75;outline:none;background:rgba(245,220,185,.035);overflow-wrap:anywhere}
.vault-canvas:focus{border-color:#d7b38a}
.vault-canvas:empty:before{content:attr(data-placeholder);opacity:.5;pointer-events:none}
.vault-canvas img{max-width:100%;height:auto;border-radius:10px}
.vault-canvas a{color:#dcbf91;text-decoration:underline}
.legacy-entry{padding:12px 0;border-bottom:1px solid #8a725244}
.legacy-entry img{max-width:100%;max-height:240px;object-fit:contain}
@media(max-width:480px){.brand strong{font-size:1rem}nav button{min-width:105px}}

/* v6.1: approachable shared writing controls */
.canvas-toolbar{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;gap:7px;padding:10px 0;max-width:100%;-webkit-overflow-scrolling:touch}
.canvas-toolbar button{flex:0 0 auto;white-space:nowrap;min-height:42px;font-size:14px}
.writing-extras{border:1px solid #7d5e48;border-radius:12px;margin:9px 0 14px;padding:11px 13px;background:rgba(30,20,17,.3)}
.writing-extras summary{cursor:pointer;font-size:14px;color:#e9cba5}
.writing-extras-content{display:flex;flex-wrap:wrap;align-items:end;gap:10px;padding-top:14px}
.writing-extras-content label{display:flex;flex-direction:column;gap:5px;font-size:13px;flex:1 1 110px}
.writing-extras-content input[type=color]{width:100%;height:42px;padding:3px;min-width:70px}
.writing-extras-content select{width:100%;min-height:42px}
.writing-extras-content button{width:auto;min-height:42px}
.symbol-inserts{display:flex;flex-wrap:wrap;gap:7px;align-items:center;width:100%}
.symbol-inserts span{width:100%;font-size:13px}
.symbol-inserts button{min-width:40px;padding:7px 10px}

/* v6.2: compact Word-inspired ribbon and off-canvas navigation */
body{padding-bottom:0;font-family:Montserrat,'Century Gothic',Arial,sans-serif}
header{justify-content:flex-start;gap:12px}
.brand{margin-right:auto}.brand strong{font-family:Montserrat,'Century Gothic',Arial,sans-serif}
h1,h2,h3{font-family:Montserrat,'Century Gothic',Arial,sans-serif}
.menu-toggle{display:flex;align-items:center;justify-content:center;flex:0 0 43px;width:43px;height:43px;padding:0;font-size:24px;background:transparent;border:1px solid #9a785e;border-radius:10px}
.nav-shade{position:fixed;inset:0;background:#0b0505a8;z-index:49}
.nav-shade[hidden]{display:none}
#chamberNav{position:fixed;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;top:0;bottom:0;left:0;right:auto;transform:translateX(-105%);width:min(82vw,340px);max-width:none;overflow-y:auto;overflow-x:hidden;background:#291713;border-right:1px solid #a38365;border-top:0;border-radius:0;box-shadow:10px 0 30px #0007;z-index:50;padding:20px 15px calc(20px + env(safe-area-inset-bottom));gap:7px;transition:transform .2s ease}
body.menu-open #chamberNav{transform:translateX(0)}
#chamberNav .nav-title{display:flex;align-items:center;justify-content:space-between;color:#e7cba5;font-weight:700;padding:8px 7px 17px;font-size:1.12rem}
#chamberNav .nav-title button{font-size:26px;min-width:40px;padding:0;background:transparent;border:0}
#chamberNav button[data-tab]{flex:none;width:100%;text-align:left;min-width:0;font-size:1rem;padding:16px 15px;border-radius:10px}
.word-ribbon{position:sticky;top:0;z-index:6;background:#2c1b16;border:1px solid #80604b;border-radius:12px;margin:12px 0 15px;padding:7px}
.ribbon-main,.ribbon-group{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.ribbon-main{flex-wrap:nowrap;min-width:0}
.word-ribbon button{border:0;background:transparent;min-height:36px;min-width:33px;padding:5px 8px;border-radius:6px;font-size:15px}
.word-ribbon button:active,.word-ribbon button:hover{background:#71503d}
.word-ribbon select{width:auto;min-width:0;max-width:130px;margin:0;padding:7px 5px;font-size:13px;border-radius:6px}
.ribbon-sep{width:1px;height:26px;background:#866750;margin:0 3px;flex-shrink:0}
#ribbonMore{margin-left:auto;white-space:nowrap;font-size:12px}
.ribbon-extras{padding:9px 3px 4px;border-top:1px solid #80604b;margin-top:8px}
.ribbon-extras[hidden]{display:none}
.ribbon-group{gap:6px;padding:5px 0}
.ribbon-group button{border:1px solid #775844;font-size:13px}
.ribbon-group label{display:flex;align-items:center;gap:5px;margin:0;font-size:12px;font-weight:400}
.ribbon-group input[type=color]{width:34px;height:30px;margin:0;padding:2px;border-radius:6px}
.vault-canvas{font-family:Montserrat,'Century Gothic',Arial,sans-serif}
@media(max-width:420px){.word-ribbon button{min-width:29px;padding:5px 6px}.word-ribbon select{max-width:105px}.brand strong{font-size:1rem}}

/* v6.4: compact responsive drawer and readable editor */
#chamberNav{width:min(78vw,300px);padding:18px 14px 30px;gap:2px}
#chamberNav .nav-title{padding:6px 8px 12px;font-size:1rem}
#chamberNav button[data-tab]{padding:10px 12px;min-height:42px;font-size:.88rem;border:0;background:transparent;text-align:left;line-height:1.35;border-radius:7px}
#chamberNav button[data-tab]:hover,#chamberNav button[aria-current="page"]{background:#654535}
.word-ribbon{position:relative;max-width:100%;box-sizing:border-box}
.ribbon-main{overflow-x:auto;scrollbar-width:thin}
.ribbon-main>button,.ribbon-main>select{flex-shrink:0}
.ribbon-extras{max-width:100%}
.ribbon-group{flex-wrap:wrap}
.check-row{display:flex;align-items:baseline;gap:9px;margin:7px 0;list-style:none}
.check-toggle{cursor:pointer;user-select:none;display:inline-block;min-width:22px;font-size:1.1em;color:inherit}
.check-toggle[aria-checked="true"]+.check-copy{text-decoration:line-through;opacity:.68}
.search-hit{display:flex;flex-direction:column;align-items:flex-start;text-align:left;width:100%;gap:9px;margin:12px 0;padding:17px;line-height:1.45;white-space:normal;cursor:pointer}
.search-hit strong{font-size:1.03rem}.hit-preview{font-weight:400;overflow-wrap:anywhere}
.snapshot-entry{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 0;border-top:1px solid #765846}
.snapshot-entry span{overflow-wrap:anywhere;min-width:0}.snapshot-entry button{flex-shrink:0;font-size:.78rem;padding:8px}
html[data-theme="light"] #chamberNav{background:#f7ecdf;color:#38241c;border-color:#b3987d}
html[data-theme="light"] #chamberNav .nav-title,html[data-theme="light"] #chamberNav button,html[data-theme="light"] #chamberNav button[data-tab]{color:#38241c}
html[data-theme="light"] #chamberNav button[aria-current="page"]{background:#e5d0b9}
html[data-theme="light"] .word-ribbon{background:#f5e9dc;color:#38241c;border-color:#aa8d73}
html[data-theme="light"] .word-ribbon button,html[data-theme="light"] .word-ribbon select{color:#38241c;background:#fff9f2}
html[data-theme="light"] .word-ribbon .ribbon-extras{border-color:#b49a82}
html[data-theme="light"] .vault-canvas{background:#fffaf4;color:#302018;border-color:#b89c7f}
html[data-theme="light"] h1,html[data-theme="light"] h2,html[data-theme="light"] h3,html[data-theme="light"] .brand strong{color:#38241c}
html[data-theme="light"] .muted{color:#705342}
html[data-theme="light"] .search-hit{background:#fff9f2;color:#38241c;border-color:#a98b71}
html[data-theme="light"] .check-toggle{color:#38241c}
@media(max-width:420px){#chamberNav{width:min(78vw,292px)}.snapshot-entry{align-items:flex-start;flex-direction:column}.snapshot-entry button{align-self:flex-start}}

/* v6.5: compact Vault, unobtrusive navigation, editor alignment */
#chamberNav{width:min(68vw,258px);background:rgba(39,23,19,.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:14px 11px 22px;gap:2px}
#chamberNav button[data-tab]{min-height:38px;padding:8px 10px;font-size:.84rem}
#chamberNav button[aria-current="page"]{background:#7c5641;box-shadow:inset 3px 0 #e6c49b;font-weight:700}
.nav-shade{background:rgba(15,9,7,.34)}
html[data-theme="light"] #chamberNav{background:rgba(249,239,225,.93)}
html[data-theme="light"] #chamberNav button[aria-current="page"]{background:#ddc5a9;box-shadow:inset 3px 0 #7b4b34}
.vault-home{padding:16px 0 50px}.vault-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.vault-head h1{margin:0}.vault-add{white-space:nowrap;padding:9px 13px;min-height:40px}
.vault-controls{display:flex;align-items:center;gap:7px;margin-bottom:14px;flex-wrap:wrap}.vault-controls input{flex:1 1 125px;min-width:110px;margin:0;padding:10px}.vault-controls select{flex:0 1 100px;min-width:88px;margin:0;padding:10px}.vault-view{display:flex;border:1px solid #a78566;border-radius:10px;overflow:hidden}.vault-view button{border:0;border-radius:0;padding:7px 10px;min-height:38px;min-width:37px;background:transparent}.vault-view button[aria-pressed="true"]{background:#8b654b;color:#fff5e9}
.vault-collections{display:grid;gap:10px}.vault-collections.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vault-collections.list{grid-template-columns:1fr}
.vault-card{min-width:0;min-height:118px;display:flex;flex-direction:column;gap:7px;text-align:left;padding:14px;border-radius:13px;border:1px solid #927052;background:#402a22;color:#f8e9d7;overflow:hidden;box-shadow:none}
.vault-card strong{font-size:1rem;line-height:1.3;overflow-wrap:anywhere}.vault-card span{font-size:.76rem;line-height:1.45;color:#e0c5a8;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.vault-card small{font-size:.67rem;color:#c8a98b;margin-top:auto}.vault-collections.list .vault-card{min-height:76px;padding:12px 15px}.vault-card[hidden]{display:none}
html[data-theme="light"] .vault-card{background:#fff8ef;color:#3d281f;border-color:#c4a78b}html[data-theme="light"] .vault-card span{color:#70513d}html[data-theme="light"] .vault-card small{color:#785a43}html[data-theme="light"] .vault-view button[aria-pressed="true"]{background:#7e5741;color:white}
#textAlign{max-width:135px}.vault-canvas [style*="background-color"]{border-radius:2px}
@media(max-width:380px){#chamberNav{width:67vw}.vault-controls{gap:5px}.vault-card{padding:11px;min-height:105px}}

/* v6.5.1 fixes: narrower visibly translucent drawer and accessible collection dialog */
#chamberNav{width:min(56vw,218px)!important;background:rgba(39,23,19,.74)!important;backdrop-filter:blur(20px) saturate(115%);-webkit-backdrop-filter:blur(20px) saturate(115%);box-shadow:8px 0 25px #0005}
html[data-theme="light"] #chamberNav{background:rgba(248,235,218,.76)!important}
#chamberNav button[data-tab]{font-size:.79rem;padding:8px 7px;min-height:37px}
#chamberNav .nav-title{font-size:.88rem;padding:7px 2px 13px}
.collection-modal-overlay{position:fixed;inset:0;z-index:100;background:#100a08b9;display:flex;align-items:center;justify-content:center;padding:18px}
.collection-modal{width:min(100%,400px);background:#35231c;color:#f8e7d3;border:1px solid #b58b63;border-radius:16px;padding:23px;box-shadow:0 12px 45px #0008}
.collection-modal h2{margin:0 0 15px}.collection-modal label{display:block;margin-bottom:8px}.collection-modal input{width:100%;box-sizing:border-box}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:17px}
html[data-theme="light"] .collection-modal{background:#fff8f0;color:#38241c}
.check-copy{min-width:2em;white-space:pre-wrap;overflow-wrap:anywhere}.check-row{display:flex;align-items:flex-start;gap:8px}.check-toggle{flex:0 0 23px}