/* ANKLE OS shell — dump.fm energy: left apps · right friends · bottom messages
 * Collapsible on all surfaces. Mobile-first. Ankle96 chrome. No indigo.
 * v=20260721-shell28
 */
:root{
  --aos-left-w: 188px;
  --aos-right-w: 196px;
  --aos-bottom-h: 52px;
  --aos-bottom-open: min(42vh, 320px);
  --aos-z: 9000;
  --aos-bg: #c0c0c0;
  --aos-panel: #d4d0c8;
  --aos-ink: #000;
  --aos-dim: #404040;
  --aos-line: #000;
}

/* body padding when panels open (desktop) */
body.aos-has-shell{ min-height: 100vh; }
@media(min-width:901px){
  body.aos-left-open{ padding-left: var(--aos-left-w); }
  body.aos-right-open{ padding-right: var(--aos-right-w); }
  body.aos-bottom-open{ padding-bottom: var(--aos-bottom-h); }
  /* A person's custom site is an authored canvas, not an OS work pane. */
  body[data-aos-surface="personal-site"].aos-left-open{ padding-left:0 !important; }
  body[data-aos-surface="personal-site"].aos-right-open{ padding-right:0 !important; }
}
@media(max-width:900px){
  body.aos-left-open:not([data-aos-surface="personal-site"]),
  body.aos-right-open:not([data-aos-surface="personal-site"]),
  body.aos-bottom-open:not([data-aos-surface="personal-site"]){ padding-left:0; padding-right:0; padding-bottom:0; }
}

/* ── edge tabs (always reachable) ── */
.aos-tab{
  position: fixed; z-index: calc(var(--aos-z) + 2);
  background: var(--aos-bg); color: var(--aos-ink);
  border: 2px solid; border-color: #fff #808080 #808080 #fff;
  font: 10px/1 "Courier New", Courier, monospace;
  text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; padding: 6px 8px;
  box-shadow: none !important; border-radius: 0 !important;
}
.aos-tab:hover{ background: #000; color: #fff; }
.aos-tab-left{
  left: 0; top: 42%; transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center; margin-left: 18px;
}
.aos-tab-right{
  right: 0; top: 42%; transform: translateY(-50%) rotate(90deg);
  transform-origin: right center; margin-right: 18px;
}
.aos-tab-bottom{
  left: 50%; bottom: 0; transform: translateX(-50%);
  border-bottom: 0;
}
body.aos-left-open .aos-tab-left{ display: none; }
body.aos-right-open .aos-tab-right{ display: none; }
body.aos-bottom-open .aos-tab-bottom{ bottom: var(--aos-bottom-h); }
body.aos-bottom-expanded .aos-tab-bottom{ bottom: var(--aos-bottom-open); }

/* ── panels ── */
.aos-panel{
  position: fixed; z-index: var(--aos-z);
  background: var(--aos-bg); color: var(--aos-ink);
  border: 2px solid; border-color: #fff #000 #000 #fff;
  font: 11px/1.35 "Courier New", Courier, monospace;
  display: flex; flex-direction: column;
  box-shadow: none !important; border-radius: 0 !important;
}
.aos-panel[hidden]{ display: none !important; }

.aos-hd{
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #000; color: #fff;
  padding: 4px 6px; text-transform: uppercase; letter-spacing: .05em;
  flex: 0 0 auto;
}
.aos-hd button{
  background: var(--aos-bg); color: #000; border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  font: 10px "Courier New", monospace; padding: 0 6px; cursor: pointer;
  min-width: 18px; height: 16px;
}
.aos-hd button:hover{ background: #fff; }
.aos-hd .aos-hd-actions{display:flex;align-items:center;gap:4px;min-width:0}
.aos-hd .aos-home{
  color:#fff !important;text-decoration:none !important;text-transform:none;
  letter-spacing:0;font-size:9px;white-space:nowrap;padding:1px 2px;
}
.aos-hd .aos-home:hover,.aos-hd .aos-home:focus{background:#fff;color:#000 !important;outline:none}

.aos-body{ flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; padding: 6px; }
.aos-sec{
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--aos-dim); margin: 8px 0 4px; border-bottom: 1px solid #808080; padding-bottom: 2px;
}
.aos-link{
  display: block; padding: 4px 6px; color: #000 !important; text-decoration: none !important;
  border: 1px solid transparent;
}
.aos-link:hover, .aos-link.active{
  background: #000 !important; color: #fff !important;
}
.aos-link .dim{ color: inherit; opacity: .7; font-size: 10px; }

/* left */
#aos-left{
  left: 0; top: 0; bottom: 0; width: var(--aos-left-w);
  border-left: 0;
}
/* rail must clear the bottom player bar — last items (LAYOUT tools) were hidden */
body.aos-bottom-open #aos-left{ bottom: var(--aos-bottom-h); }
body.aos-bottom-open #aos-right{ bottom: var(--aos-bottom-h); }
/* right */
#aos-right{
  right: 0; top: 0; bottom: 0; width: var(--aos-right-w);
  border-right: 0;
}
/* bottom bar */
#aos-bottom{
  left: 0; right: 0; bottom: 0; height: var(--aos-bottom-h);
  border-bottom: 0; flex-direction: column;
}
body.aos-bottom-expanded #aos-bottom{ height: var(--aos-bottom-open); }
#aos-bottom .aos-bottom-bar{
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; flex: 0 0 var(--aos-bottom-h);
  border-top: 1px solid #808080; background: var(--aos-panel);
}
#aos-bottom .aos-bottom-bar input{
  flex: 1; min-width: 0; border: 2px solid; border-color: #808080 #fff #fff #808080;
  background: #fff; padding: 5px 8px; font: 12px "Courier New", monospace;
}
#aos-bottom .aos-bottom-bar button{
  border: 2px solid; border-color: #fff #808080 #808080 #fff;
  background: var(--aos-bg); padding: 4px 8px; font: 10px "Courier New", monospace;
  text-transform: uppercase; cursor: pointer;
}
#aos-bottom .aos-bottom-bar button.primary{ background: #000; color: #fff; border-color: #000; }
#aos-bottom .aos-drawer{
  display: none; flex: 1; overflow: auto; padding: 6px 8px; background: #fff;
  border-top: 1px solid #000;
}
body.aos-bottom-expanded #aos-bottom .aos-drawer{ display: block; }

/* friends rows */
.aos-friend{
  display: flex; align-items: center; gap: 6px; padding: 4px 2px;
  border-bottom: 1px solid #ddd; cursor: pointer;
}
.aos-friend:hover{ background: #eee; }
.aos-friend img, .aos-friend .av{
  width: 22px; height: 22px; border: 1px solid #999; background: #ddd;
  object-fit: cover; flex: 0 0 22px;
}
.aos-friend .av{
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.aos-friend .name{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aos-dot{
  width: 7px; height: 7px; border: 1px solid #000; background: #808080; flex: 0 0 7px;
}
.aos-dot.on{ background: #00a000; }
.aos-muted{ color: var(--aos-dim); font-size: 10px; padding: 6px 2px; }
.aos-badge{
  display: inline-block; min-width: 14px; padding: 0 4px; background: #000; color: #fff;
  font-size: 9px; text-align: center; margin-left: 4px;
}
.aos-badge[hidden]{display:none !important}

/* exact conversation rows + visible unread state */
.aos-convo-link{display:flex !important;align-items:center;gap:8px;min-width:0}
.aos-convo-link .aos-convo-main{flex:1;min-width:0}
.aos-convo-link .aos-convo-main b,
.aos-convo-link .aos-convo-main .dim{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aos-convo-link.unread{background:#ffffe0 !important;color:#000 !important;border-color:#000;font-weight:bold}
.aos-thread-unread{flex:0 0 auto;min-width:18px;padding:2px 5px;background:#000;color:#fff;text-align:center;font-size:9px}

/* one audio surface: switch Music library / Radio exploration inside it */
.aos-audio-switch{display:flex;gap:0;padding:4px 12px 0}
.aos-audio-switch button,
.aos-post-drawer button{font:10px "Courier New",monospace;text-transform:uppercase;background:var(--panel,#c0c0c0);color:var(--fg,#000);border:2px outset #fff;cursor:pointer;padding:5px 10px}
.aos-audio-switch button.on{background:var(--highlight,#ffffe0);color:#000;font-weight:bold;border-style:inset}

/* Post is a real rail mode, not a redirect. */
#aos-bar-post input[type="text"]{flex:1;min-width:80px}
#aos-post-files.ready{background:var(--highlight,#ffffe0) !important;color:#000 !important;font-weight:bold}
.aos-post-status{flex:0 1 180px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:var(--muted,#333)}
.aos-post-status a{color:var(--link,#00e)}
.aos-post-drawer{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px;max-width:620px}
.aos-pm-media{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:8px 10px 0}
.aos-pm-attach{font:10px "Courier New",monospace;background:var(--panel,#c0c0c0);color:var(--fg,#000);border:2px outset #fff;cursor:pointer;padding:5px 9px}
.aos-pm-file{display:inline-flex;align-items:center;gap:5px;max-width:180px;padding:3px 5px;background:#fff;color:#000;border:1px solid #808080;font:10px "Courier New",monospace}
.aos-pm-file>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aos-pm-file button{flex:0 0 auto;border:0;background:#000;color:#fff;cursor:pointer;line-height:1}

/* top editable chips strip (optional secondary) */
#aos-topchips{
  position: sticky; top: 0; z-index: calc(var(--aos-z) - 1);
  display: none; gap: 0; flex-wrap: wrap;
  background: var(--aos-bg); border-bottom: 1px solid #000;
  padding: 0; font: 10px "Courier New", monospace;
}
body.aos-top-open #aos-topchips{ display: flex; }
#aos-topchips a{
  padding: 5px 8px; border-right: 1px solid #999; color: #000 !important;
  text-decoration: none !important; text-transform: uppercase;
}
#aos-topchips a:hover, #aos-topchips a.on{ background: #000 !important; color: #fff !important; }
#aos-topchips .aos-edit{
  margin-left: auto; border: 0; border-left: 1px solid #999;
  background: transparent; padding: 5px 8px; cursor: pointer;
  font: 10px "Courier New", monospace; text-transform: uppercase;
}

/* Personal builds may define body as a row/column flex canvas. A sticky strip
   is then a flex child and can stretch into a full-height column, squeezing
   the authored site off-screen. Keep OS chrome available, but overlay it on
   personal sites so it never participates in their layout. */
body[data-aos-surface="personal-site"].aos-top-open #aos-topchips{
  position:fixed !important; inset:0 0 auto 0 !important;
  width:100% !important; max-width:100% !important; min-width:0 !important;
  box-sizing:border-box !important;
  height:auto !important; min-height:24px; align-self:auto !important;
  flex:0 0 auto !important;
}
body[data-aos-surface="personal-site"].aos-bottom-open{
  padding-bottom:calc(72px + env(safe-area-inset-bottom)) !important;
}

/* mobile drawers overlay content instead of permanent padding */
@media(max-width:900px){
  /* The fixed rail must reserve space so page composers/actions scroll above it. */
  body.aos-bottom-open{padding-bottom:calc(var(--aos-bottom-h) + env(safe-area-inset-bottom)) !important}
  body.aos-bottom-expanded{padding-bottom:calc(var(--aos-bottom-open) + env(safe-area-inset-bottom)) !important}
  #aos-left, #aos-right{
    width: min(86vw, 280px);
    box-shadow: 4px 0 0 rgba(0,0,0,.15);
  }
  #aos-right{ box-shadow: -4px 0 0 rgba(0,0,0,.15); }
  .aos-tab-left{ margin-left: 14px; }
  .aos-tab-right{ margin-right: 14px; }
  /* dim page when a side drawer is open */
  body.aos-left-open::after,
  body.aos-right-open::after{
    content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35);
    z-index: calc(var(--aos-z) - 1); pointer-events: auto;
  }
  #aos-bottom .aos-bottom-bar{overflow-x:auto;overscroll-behavior-x:contain}
  #aos-bar-post .aos-post-status{display:none}
}

/* hide legacy thin top rail when full shell is present to avoid double chrome */
body.aos-has-shell #ankle-os-rail{ display: none !important; }

/* Versioned legal acknowledgement. It sits above the OS rail, never behind it. */
#aos-legal-banner{
  position:fixed;left:50%;bottom:calc(var(--aos-bottom-h,52px) + 10px);
  transform:translateX(-50%);z-index:2147483500;
  width:min(860px,calc(100vw - 24px));max-height:min(46vh,360px);overflow:auto;
  box-sizing:border-box;padding:10px 12px;background:#ffff00;color:#000;
  border:2px solid #000;box-shadow:inset 2px 2px 0 #fff,inset -2px -2px 0 #808080,6px 6px 0 rgba(0,0,0,.45);
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;
  font:11px/1.45 "Courier New",monospace;
}
#aos-legal-banner a{color:#0000aa!important;text-decoration:underline!important;font-weight:bold}
.aos-legal-copy strong{display:inline-block;margin-right:2px}
.aos-legal-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.aos-legal-state{font-size:9px;max-width:150px}
.aos-legal-accept{font:bold 10px "Courier New",monospace;padding:8px 10px;background:#c0c0c0;color:#000;border:2px outset #fff;cursor:pointer;white-space:nowrap}
.aos-legal-accept:active{border-style:inset}
.aos-legal-accept:disabled{color:#666;cursor:wait}
#aos-legal-banner.aos-legal-done{opacity:0;transition:opacity .2s}
@media(max-width:700px){
  #aos-legal-banner{bottom:calc(var(--aos-bottom-h,52px) + env(safe-area-inset-bottom) + 8px);grid-template-columns:1fr;gap:8px;padding:9px 10px;width:calc(100vw - 16px);font-size:10px}
  .aos-legal-actions{justify-content:space-between;flex-wrap:wrap}
  .aos-legal-accept{white-space:normal;text-align:center;min-height:44px;flex:1}
}
@media print{#aos-legal-banner{display:none!important}}

/* don't fight world edit chrome / full canvas editors if marked */
body.aos-shell-disabled .aos-tab,
body.aos-shell-disabled .aos-panel,
body.aos-shell-disabled #aos-topchips{ display: none !important; }

/* Custom scrollbar for OS panels to match the red/green theme */
.aos-body::-webkit-scrollbar, .aos-drawer::-webkit-scrollbar { width: 8px; height: 8px; }
.aos-body::-webkit-scrollbar-track, .aos-drawer::-webkit-scrollbar-track { background: red; border-left: 1px solid #000; }
.aos-body::-webkit-scrollbar-thumb, .aos-drawer::-webkit-scrollbar-thumb { background: #00ff00; border: 1px solid #000; }
