/* Shared chrome: the same identity and dark blue on every workspace. */
body{background:var(--bg);--main-nav-height:54px}
.shell,body.entries-workspace .shell{padding-top:20px}
.masthead,body.entries-workspace .masthead{padding:9px;margin-bottom:15px}
.masthead-main,body.entries-workspace .masthead-main{--mast-height:150px;grid-template-columns:minmax(380px,410px) minmax(0,1fr)}
.brand h1,body.entries-workspace .brand h1{font-size:clamp(1.6rem,2.6vw,2rem)}
.kicker,body.entries-workspace .kicker{font-size:.9rem}
#nav,body.entries-workspace #nav{position:sticky;top:0;z-index:40;align-items:center;gap:8px;margin:0;padding:7px 0 9px;background:var(--bg);border-bottom:1px solid var(--line)}
#nav>button,#nav>a,.creator-tools>summary,body.entries-workspace #nav button,body.entries-workspace #nav>a{font-size:1rem;min-height:40px;padding:6px 11px}
#nav>button{border:1px solid var(--line);border-radius:8px;background:var(--panel);min-height:44px}
#nav>button[aria-current="page"]{color:var(--text);border-color:var(--line);background:var(--panel)}
#nav>button:hover,.creator-tools>summary:hover{color:var(--text);background:var(--panel2)}
.creator-tools{position:relative;margin:0 0 0 auto;color:var(--muted)}
.creator-tools>summary{border:1px solid var(--line);border-radius:8px;color:var(--muted);list-style:none;display:flex;align-items:center;gap:10px}
.creator-tools>summary::-webkit-details-marker{display:none}
.creator-tools>summary::after{content:'▾';font-size:.8rem;color:var(--accent)}
.creator-tools.has-current>summary,.creator-tools[open]>summary{color:var(--accent);border-color:var(--accent);background:var(--panel)}
.creator-menu,.recent-menu{position:absolute;right:0;top:calc(100% + 7px);z-index:45;min-width:245px;max-width:min(330px,88vw);padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:0 12px 30px #0008}
#nav .creator-menu button,.recent-menu button{display:block;width:100%;border:0;border-radius:6px;background:transparent;text-align:left;color:var(--text);padding:9px 12px;min-height:44px;font-size:.95rem}
#nav .creator-menu button:hover,#nav .creator-menu button[aria-current="page"],.recent-menu button:hover{background:var(--panel2);color:var(--accent)}
.entry-pickers,.entries-workspace .entry-pickers{top:var(--main-nav-height)}
.entry-pickers>label,.entry-pickers>label[for="realm-filter"]{color:var(--accent);font-family:Papyrus,'Palatino Linotype',Palatino,serif;font-size:.9rem;font-weight:400}
/* Form values, search appearance, and the existing 44px field dimensions stay intact. */
.entry-pickers select,.entry-pickers input{font-family:Palatino,'Palatino Linotype','Book Antiqua',Georgia,serif}
.entry-edit-controls{display:flex;flex-wrap:wrap;gap:7px;margin-left:auto;align-items:center}
.entry-edit-controls[hidden]{display:none}
.entry-edit-controls .subtle{font-size:.87rem;min-height:40px;border-color:var(--line);padding:5px 10px}
.entry-edit-controls #inline-edit-toggle[aria-pressed="true"]{color:var(--accent);border-color:var(--accent)}
body.inline-edit-active .entry-edit-controls{position:sticky;top:var(--entry-controls-height,130px);z-index:30;background:var(--panel)}
.entry-toolbar .stats{align-items:center;gap:6px 12px}
.recent-entries{order:1;position:relative;margin:0;font-size:.82rem}
.archive-summary-toggle,.recent-entries>summary{padding:6px 3px;margin:0;color:var(--muted);font-size:.82rem;min-height:36px;display:inline-flex;align-items:center;gap:6px;list-style:none;white-space:nowrap}
.archive-summary-toggle{background:transparent;border:0;border-radius:5px;font-family:inherit;flex:none}
.archive-summary-toggle>span{color:var(--accent)}
.recent-entries>summary::after{content:'▾';color:var(--accent)}
.archive-summary-counts[hidden]{display:none}
.archive-summary-counts:not([hidden]){display:contents}
.archive-summary-counts>.stat{white-space:nowrap}
.archive-version{order:2;flex-basis:100%;color:var(--muted);font-size:.75rem;overflow-wrap:anywhere;padding:2px 0}
.recent-menu{right:auto;left:0;top:100%;z-index:25}
.entry-toolbar-actions .subtle{font-size:.8rem;min-height:36px;padding:5px 8px;border-color:var(--line)}
:where(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.skip-link{position:fixed;left:16px;top:-80px;z-index:100;padding:10px 16px;border:1px solid var(--accent);border-radius:8px;background:var(--bg);color:var(--accent)}
.skip-link:focus{top:12px}
@media(max-width:950px){
 .masthead-main,body.entries-workspace .masthead-main{--mast-height:110px;grid-template-columns:minmax(290px,340px) minmax(0,1fr)}
 .brand{min-height:0}
 .brand h1,body.entries-workspace .brand h1{font-size:1.7rem}
 .kicker,body.entries-workspace .kicker{font-size:.75rem}
}
@media(max-width:600px){
 .shell,body.entries-workspace .shell{padding-top:12px}
 .masthead-main,body.entries-workspace .masthead-main{--mast-height:80px;grid-template-columns:1fr;gap:8px}
 .brand,body.entries-workspace .brand{gap:12px}
 .mast-art{height:76px}
 #nav,body.entries-workspace #nav{display:flex;flex-wrap:wrap;gap:3px;padding:5px 0}
 #nav>button,#nav>a,.creator-tools>summary,body.entries-workspace #nav button,body.entries-workspace #nav>a{font-size:.88rem;min-height:44px;padding:6px 8px}
 .creator-tools{margin-left:auto}
 .creator-menu{min-width:230px}
 .entry-pickers>label{font-size:.85rem}
 .entry-edit-controls{margin-left:0}
 .dossier-title{align-items:center}
}

/* One browsing row: Entries, Realm, Category, Search, Creator Tools. */
#nav.has-archive-filters,body.entries-workspace #nav.has-archive-filters{display:grid;grid-template-columns:auto minmax(130px,.7fr) minmax(205px,1.05fr) minmax(235px,1.4fr) auto;gap:14px;align-items:end;padding:10px 0 12px}
#archive-nav-filters:not([hidden]),#nav .entry-pickers{display:contents}
#archive-nav-filters[hidden]{display:none}
#nav .entry-pickers>label{min-width:0;margin:0;font-family:Papyrus,'Palatino Linotype',Palatino,serif;font-size:.9rem;font-weight:400;color:var(--accent)}
#nav .entry-pickers input,#nav .entry-pickers select{margin-top:4px}
#nav.has-archive-filters>button,#nav.has-archive-filters>.creator-tools,#nav.has-archive-filters>a{align-self:end;margin-bottom:2px}
#nav.has-archive-filters>.creator-tools{margin-left:0}
#nav.has-archive-filters>a{white-space:nowrap}
#nav .entry-pickers .sr-only{position:absolute;left:0;top:0;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* The app name leads; the engine name is a supporting subtitle. */
.masthead-main,body.entries-workspace .masthead-main{grid-template-columns:minmax(400px,435px) minmax(0,1fr)}
.brand{--brand-title-size:clamp(1.55rem,2.4vw,1.9rem)}
.brand-title,.brand-subtitle{font-variant-caps:small-caps}
.brand .brand-title,body.entries-workspace .brand .brand-title{font-size:var(--brand-title-size);color:var(--accent);line-height:1.18;margin:0 0 9px}
.brand-subtitle{text-align:center;font-size:calc(var(--brand-title-size) * .8);line-height:1.3;color:var(--text);font-family:Papyrus,'Palatino Linotype',Palatino,serif}
/* Reference page introductions have room above and below their gold eyebrow. */
.compass-page,.chronology-page{padding-top:26px}
.reference-back{display:inline-block;margin:0 0 20px;border-color:var(--line)}
.compass-title .eyebrow,.chronology-page>.eyebrow{margin:0 0 16px;line-height:1.6}
.compass-title h2,.chronology-page>h2{margin:0 0 20px;line-height:1.3}
.compass-title p{margin-top:12px}
.compass-guide-link{color:var(--accent);font:inherit;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}
.compass-guide-link:hover{text-decoration-style:solid}
.compass-guide-link span{font-size:.72em;margin-left:4px}
.entry-toolbar-actions .button{text-decoration:none;color:var(--accent);display:inline-flex;align-items:center}
/* Give the archive card another 65px without widening the whole application. */
@media(min-width:851px){
 .entries-workspace .layout{grid-template-columns:minmax(205px,235px) minmax(0,1fr)}
 .entries-workspace .entry-list button{overflow-wrap:anywhere}
 .entries-workspace .individual-views button{font-size:.72rem;padding-left:2px;padding-right:2px}
}
@media(max-width:1100px){
 #nav.has-archive-filters,body.entries-workspace #nav.has-archive-filters{grid-template-columns:minmax(0,.8fr) minmax(0,1.15fr) minmax(0,1.4fr);gap:8px 12px}
 #nav.has-archive-filters>button{grid-column:1;grid-row:1;justify-self:start}
 #nav.has-archive-filters>.creator-tools,#nav.has-archive-filters>a{grid-column:3;grid-row:1;justify-self:end}
 #nav .entry-pickers>label{grid-row:2}
}
@media(max-width:950px){
 .masthead-main,body.entries-workspace .masthead-main{grid-template-columns:minmax(315px,350px) minmax(0,1fr)}
 .brand{--brand-title-size:1.55rem}
}
@media(max-width:600px){
 .masthead-main,body.entries-workspace .masthead-main{grid-template-columns:1fr}
 .brand{--brand-title-size:1.5rem}
 .brand .brand-title,body.entries-workspace .brand .brand-title{margin-bottom:5px}
 #nav.has-archive-filters,body.entries-workspace #nav.has-archive-filters{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:7px 10px;padding-top:6px;padding-bottom:9px}
 #nav.has-archive-filters>.creator-tools,#nav.has-archive-filters>a{grid-column:2}
 #nav .entry-pickers>label:last-of-type{grid-column:1/-1;grid-row:3}
 #nav .entry-pickers>label{font-size:.85rem}
 .compass-page,.chronology-page{padding-top:20px}
}

#nav.has-archive-filters>button[data-view="entries"]{height:44px;margin-bottom:0}
.history-chronology-link,body[data-public-canon] .history-chronology-link{color:#17232a;display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;margin:2px 0 12px;text-decoration:none;line-height:1.3;min-height:46px;font-size:1rem;flex:none}
.history-chronology-link:hover{background:#f0ce91;color:#17232a}

/* Personal favorites follow Recently Viewed without changing its position. */
.favorite-entries{order:1;position:relative;margin:0;font-size:.82rem}
.favorite-entries>summary{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:6px 3px;color:var(--muted);list-style:none;white-space:nowrap}
.favorite-entries>summary::-webkit-details-marker{display:none}
.favorite-entries>summary::after{content:'▾';color:var(--accent)}
.favorite-heart{display:block;flex:none;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.favorite-entries>summary .favorite-heart{width:15px;height:15px;fill:var(--accent);stroke:var(--accent)}
.favorite-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;align-self:center;min-width:44px;width:44px;height:44px;padding:8px;border:1px solid var(--line);border-radius:8px;color:var(--muted);background:transparent;margin-left:auto}
.favorite-toggle:hover{color:var(--accent);border-color:var(--accent);background:var(--panel2)}
.favorite-toggle[aria-pressed="true"]{color:var(--accent);border-color:var(--accent)}
.favorite-toggle[aria-pressed="true"] .favorite-heart{fill:currentColor}
.favorite-toggle:disabled{opacity:.5;cursor:default}
.dossier-title>.favorite-toggle+.entry-edit-controls{margin-left:0}
.favorites-menu{position:absolute;right:0;top:calc(100% + 5px);z-index:30;width:300px;max-width:88vw;max-height:min(420px,65dvh);overflow-y:auto;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:0 12px 30px #0008}
.favorites-menu button{display:block;width:100%;padding:9px 12px;min-height:44px;border:0;border-radius:6px;background:transparent;color:var(--text);font-size:.95rem;text-align:left;overflow-wrap:anywhere}
.favorites-menu button:hover{background:var(--panel2);color:var(--accent)}
.favorites-menu small{display:block;color:var(--muted);font-size:.76rem;line-height:1.35;margin-top:3px}
.favorites-empty,.favorites-storage-note{margin:6px;padding:5px;font-size:.88rem;line-height:1.45;color:var(--muted)}
@media(max-width:600px){.favorites-menu{right:auto;left:0;max-width:78vw}}
