/* aurekai-bar.css -- the one bar every Aurekai page wears.
 *
 * Front pages, native surfaces, donor surfaces, subject rooms and the sign-in
 * pages each drew their own header, so the way around the estate moved every
 * time a person followed a link.  This sheet styles one element, .ak-bar, the
 * same on all of them: the name, the four territories, search and the account
 * on the first line; the sections on the second, in one row that scrolls
 * sideways instead of wrapping or stacking.
 *
 * It takes its colours from the page it sits on (currentColor and the page's
 * own ground), so it never fights a territory's dress.
 */
.ak-bar{
  --ak-on:var(--w-ground,var(--n-ground,var(--bf-ground,var(--paper,#faf7f2))));
  --ak-line:color-mix(in srgb,currentColor 16%,transparent);
  --ak-soft:color-mix(in srgb,currentColor 9%,transparent);
  --ak-pad:clamp(1rem,4vw,3.5rem);
  position:sticky;top:0;z-index:60;box-sizing:border-box;width:calc(100vw - var(--ak-dock,0px));max-width:calc(100vw - var(--ak-dock,0px));margin-inline:calc(50% - 50vw + var(--ak-dock,0px)/2);padding:0 var(--ak-pad);
  background:color-mix(in srgb,var(--ak-on) 82%,transparent);backdrop-filter:blur(18px) saturate(1.5);-webkit-backdrop-filter:blur(18px) saturate(1.5);
  border-bottom:1px solid var(--ak-line);
  font:500 .84rem/1 'DM Sans',ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;letter-spacing:-.01em;text-transform:none;
}
/* --ak-dock is the width the activity panel takes when docked beside the
 * page; the full-bleed bar spans what is left. */
/* Directly under the body the bar is already the width of the page; the
 * viewport width would add the scrollbar to it. */
body>.ak-bar{width:auto;max-width:none;margin-inline:0}
.ak-bar *{box-sizing:border-box}
.ak-bar a{color:inherit;text-decoration:none;font-weight:500}
.ak-bar form,.ak-bar label{margin:0;padding:0;border:0;background:none;box-shadow:none;font:inherit;letter-spacing:inherit;text-transform:none;color:inherit}
.ak-bar .ak-brand{font-weight:650}
.ak-bar .ak-account{font-weight:600}
.ak-bar-top{display:flex;align-items:center;gap:.9rem;min-height:3.5rem}
.ak-brand{display:inline-flex;align-items:center;gap:.5rem;font-size:1.18rem;font-weight:650;letter-spacing:-.045em}
.ak-brand img{width:1.5rem;height:1.5rem;border-radius:50%}
.ak-places{display:flex;gap:.1rem;padding:.2rem;border:1px solid var(--ak-line);border-radius:999px}
.ak-places a{padding:.42rem .8rem;border-radius:999px;opacity:.72;transition:background .25s,opacity .25s}
.ak-places a:hover{opacity:1;background:var(--ak-soft)}
.ak-places a[aria-current="page"]{opacity:1;background:currentColor}
.ak-places a[aria-current="page"]>span{color:var(--ak-on)}
.ak-find{margin:0 0 0 auto;flex:0 1 17rem;min-width:0}
.ak-find label{display:flex;align-items:center;gap:.5rem;margin:0;padding:.5rem .9rem;border:1px solid transparent;border-radius:999px;background:var(--ak-soft);transition:border-color .25s,background .25s}
.ak-find label:focus-within{border-color:currentColor;background:transparent}
.ak-find svg{flex:none;width:.9rem;height:.9rem;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;opacity:.6}
.ak-find input{flex:1;min-width:0;width:auto;padding:0;border:0;outline:0;background:none;box-shadow:none;color:inherit;font:inherit}
.ak-find input::placeholder{color:inherit;opacity:.5}
.ak-account{flex:none;padding:.62rem 1rem;border:1px solid currentColor;border-radius:999px;font-weight:600;white-space:nowrap;transition:background .25s}
.ak-account:hover{background:currentColor}
.ak-account:hover>span{color:var(--ak-on)}
.ak-account+.ak-account{margin-left:-.5rem}
.ak-sections{display:flex;gap:.1rem;margin:0 calc(-1*var(--ak-pad));padding:0 calc(var(--ak-pad) - .7rem) .55rem;overflow-x:auto;scrollbar-width:none;
  -webkit-mask-image:linear-gradient(to right,transparent,#000 1.2rem,#000 calc(100% - 2.5rem),transparent);mask-image:linear-gradient(to right,transparent,#000 1.2rem,#000 calc(100% - 2.5rem),transparent)}
.ak-sections::-webkit-scrollbar{display:none}
.ak-sections a{flex:none;padding:.5rem .7rem;border-radius:999px;white-space:nowrap;opacity:.66;transition:background .25s,opacity .25s}
.ak-sections a:hover{opacity:1;background:var(--ak-soft)}
.ak-sections a[aria-current="page"]{opacity:1;background:currentColor}
.ak-sections a[aria-current="page"]>span{color:var(--ak-on)}
.ak-sections .ak-out{display:flex;gap:.1rem;margin-left:auto;padding-left:1.5rem}
.ak-sections .ak-out a::after{content:"\2197";margin-left:.3rem;font-size:.8em;opacity:.7}
.ak-local[hidden]{display:none}
.ak-bar :focus-visible{outline:2px solid currentColor;outline-offset:2px}

/* The headers this bar replaces, wherever a page still carries one. */
body:has(.ak-bar) :is(nav.navbar,header.topbar,nav.bar:not(.ak-sections)){display:none}
body:has(.ak-bar) .bf-native-kicker{display:none}
/* The bar carries the territories; a surface need not repeat them as chips. */
body:has(.ak-bar) .bf-native-slot>a:is([href$="/stage"],[href="/discover"]){display:none}

/* A page that centres its one form keeps doing so beneath the bar. */
body:has(>.ak-bar+main>.kicker){display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:0}
body:has(>.ak-bar+main>.kicker)>.ak-bar{flex:none;align-self:stretch;width:auto;margin-inline:0}
body:has(>.ak-bar+main>.kicker)>main{margin-block:auto;padding:1.5rem}

/* Pages whose own sheet is not the estate's say what their ground is. */
[data-bs-theme="dark"] .ak-bar{--ak-on:#000}
.ak-bar.ak-on-dark{--ak-on:#101113}

@media (max-width:760px){
  .ak-bar-top{gap:.35rem;min-height:3.25rem}
  .ak-brand{font-size:1.02rem}
  .ak-places{padding:.15rem}
  .ak-places a{padding:.38rem .44rem;font-size:.8rem}
  .ak-find{flex:0 0 2.3rem;margin-left:auto}
  .ak-find label{padding:.5rem;justify-content:center}
  .ak-find input{width:0;flex:0 0 0}
  .ak-find label:focus-within{position:absolute;left:var(--ak-pad);right:var(--ak-pad);z-index:2;background:var(--ak-on);padding:.5rem .9rem}
  .ak-find label:focus-within input{flex:1;width:auto}
  .ak-account{padding:.5rem .62rem;font-size:.8rem}
}
@media print{.ak-bar{display:none}}

/* Specialized page anatomy stays in its own stylesheet. */
@media(prefers-reduced-motion:reduce){.ak-bar *{transition:none!important;animation:none!important}}

/* One app. The Stitch screens share one ground, one footer and one player;
 * these tokens are that ground, and any page that wears .ak-app takes them.
 * Pages keep their own regions; the frame around them is this. */
:root{
  --ak-surface:#0f1511;--ak-surface-lowest:#0a100c;--ak-surface-low:#171d19;--ak-surface-mid:#1b211d;
  --ak-surface-high:#252b27;--ak-surface-highest:#303631;--ak-on-surface:#dee4dd;--ak-on-variant:#c5c9af;
  --ak-primary:#d0fc4f;--ak-on-primary:#0f1511;--ak-outline:#8e937c;--ak-outline-variant:#444935;
  --ak-serif:'Literata','Instrument Serif',Georgia,serif;--ak-sans:'DM Sans',ui-sans-serif,system-ui,sans-serif;
}
body.ak-app{margin:0;background:var(--ak-surface);color:var(--ak-on-surface);font-family:var(--ak-sans);--w-ground:var(--ak-surface)}
body.ak-app a{color:inherit}
.ak-foot{margin-top:5rem;padding:4rem clamp(1rem,4vw,3.5rem) 2.5rem;background:var(--ak-surface-lowest);color:var(--ak-on-variant);font:400 .875rem/1.6 var(--ak-sans)}
.ak-foot-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:2.5rem;max-width:80rem;margin:0 auto}
.ak-foot b{display:block;color:var(--ak-on-surface);font:600 1.15rem/1.2 var(--ak-sans);margin-bottom:.75rem}
.ak-foot h2{margin:0 0 .9rem;color:var(--ak-on-surface);font:600 .7rem/1 var(--ak-sans);letter-spacing:.12em;text-transform:uppercase}
.ak-foot ul{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}
.ak-foot a{text-decoration:none}.ak-foot a:hover{color:var(--ak-primary)}
.ak-foot-base{max-width:80rem;margin:3rem auto 0;padding-top:1.5rem;border-top:1px solid var(--ak-outline-variant);display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;font-size:.75rem}
@media (max-width:760px){.ak-foot-grid{grid-template-columns:1fr 1fr}.ak-foot-grid>div:first-child{grid-column:1/-1}}
/* The player: one docked bar for every narration and recording on the estate. */
.ak-player{position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);z-index:70;width:min(36rem,calc(100vw - 2rem));box-sizing:border-box;
  display:flex;align-items:center;gap:.75rem;padding:.6rem .75rem .6rem .6rem;border-radius:999px;background:color-mix(in srgb,var(--ak-surface-high) 95%,transparent);
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid var(--ak-outline-variant);box-shadow:0 18px 48px rgba(0,0,0,.45);color:var(--ak-on-surface);font:500 .8rem/1.3 var(--ak-sans)}
.ak-player[hidden]{display:none}
.ak-player button{flex:none;border:0;cursor:pointer;display:grid;place-items:center;border-radius:999px;font:inherit}
.ak-player button[hidden]{display:none}
.ak-player :is(.ak-prev,.ak-next){width:2rem;height:2rem;background:transparent;color:var(--ak-on-surface);font-size:.65rem;letter-spacing:-.15em}
.ak-player :is(.ak-prev,.ak-next):disabled{opacity:.35;cursor:default}
.ak-player button:focus-visible{outline:2px solid var(--ak-primary);outline-offset:3px}
.ak-player .ak-play{width:2.25rem;height:2.25rem;background:var(--ak-primary);color:var(--ak-on-primary)}
.ak-player .ak-play svg{width:1.1rem;height:1.1rem;fill:currentColor}
.ak-player .ak-x{width:1.9rem;height:1.9rem;background:transparent;color:var(--ak-on-variant)}
.ak-player .ak-x:hover{background:var(--ak-surface-mid);color:var(--ak-on-surface)}
.ak-player-meta{min-width:0;flex:1;display:flex;flex-direction:column}
.ak-player-meta span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ak-player-meta span+span{color:var(--ak-on-variant);font-weight:400}
.ak-player-bar{position:absolute;left:1.5rem;right:1.5rem;bottom:0;height:2px;background:transparent;border-radius:2px;overflow:hidden}
.ak-player-bar i{display:block;height:100%;width:0;background:var(--ak-primary)}

/* Journal controls use the same compact disclosure and filter chips on public
   indexes and the owner's private draft list. */
.ph-journal .ph-journal-tools{display:flex;align-items:center;flex-wrap:wrap;gap:.65rem;margin:0 0 1.5rem}
.ph-journal-search{position:relative}
.ph-journal-search summary,.ph-journal-filters button{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:40px;padding:.55rem .95rem;border:1px solid var(--j-rule);border-radius:999px;background:var(--j-panel);color:var(--j-ink);font:600 .8rem/1.2 var(--j-body-face);cursor:pointer}
.ph-journal-search summary{list-style:none}.ph-journal-search summary::-webkit-details-marker{display:none}
.ph-journal-search summary svg{width:1rem;height:1rem}
.ph-journal-search label{position:absolute;z-index:3;top:calc(100% + .45rem);left:0;width:min(19rem,calc(100vw - 3rem));padding:.85rem;border:1px solid var(--j-rule);border-radius:1rem;background:var(--j-ground);box-shadow:0 .5rem 1.5rem #0002}
.ph-journal-search input{margin-top:.35rem}
.ph-journal-filters{display:flex;flex-wrap:wrap;gap:.4rem}
.ph-journal-filters button[aria-pressed=true]{background:var(--j-ink);color:var(--j-ground);border-color:var(--j-ink)}
.ph-journal-search summary:hover,.ph-journal-filters button:hover{border-color:var(--j-accent)}
.ph-journal-search summary:focus-visible,.ph-journal-filters button:focus-visible,.ph-journal-search input:focus-visible{outline:3px solid var(--j-accent);outline-offset:3px}
.ph-journal .ph-journal-tools [data-journal-count]{margin:0 0 0 auto;white-space:normal}
[data-ak-track]{cursor:pointer}
/* A page that lays its body out as a grid must not let one long line widen the
 * column past the screen: the shell holds every child to the viewport. */
body.ak-app{grid-template-columns:minmax(0,1fr);max-width:100%;overflow-x:clip}
body.ak-app>*{min-width:0}
.ak-foot p{overflow-wrap:anywhere}
