/* 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: 4px 4px 0 #000 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: 4px 4px 0 #000 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; }
.aos-world-row{display:flex;align-items:center;gap:2px;min-width:0}
.aos-world-row .aos-world-link{display:flex;align-items:center;gap:6px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aos-world-ic{width:20px;height:20px;object-fit:cover;flex:0 0 20px;border:1px solid #808080;background:#fff}
.aos-world-ic-ph{display:inline-flex;align-items:center;justify-content:center;font-weight:bold}
.aos-world-star{
  display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 28px;width:28px;height:24px;padding:0;line-height:1;text-align:center;
  border:1px solid transparent;background:transparent;color:#555;
  font:700 16px/1 "Courier New",monospace;cursor:pointer;
}
.aos-world-star:hover,.aos-world-star.on{border-color:#808080;background:#fff;color:#000}
/* 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;
  background: #c0c0c0 !important;
  color: #000000 !important;
  z-index: var(--aos-z);
}
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 !important;
  background: #c0c0c0 !important;
  color: #000000 !important;
}
#aos-bottom .aos-bottom-bar * {
  color: #000000 !important;
}
#aos-bottom .aos-bottom-bar input{
  flex: 1; min-width: 0; border: 2px solid; border-color: #808080 #fff #fff #808080;
  background: #fff !important; color: #000 !important; padding: 5px 8px; font: 12px "Courier New", monospace;
}
#aos-bottom .aos-bottom-bar button{
  border: 2px solid; border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0 !important; color: #000 !important; padding: 4px 8px; font: 10px "Courier New", monospace;
  text-transform: uppercase; cursor: pointer;
}
#aos-bottom .aos-bottom-bar button.primary{ background: #000 !important; color: #fff !important; border-color: #000 !important; }
#aos-bottom .aos-bottom-bar button.primary * { color: #fff !important; }
#aos-bottom .aos-drawer{
  display: none; flex: 1; overflow: auto; padding: 6px 8px; background: #fff !important; color: #000 !important;
  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 .aos-avatar-placeholder{
  width: 22px; height: 22px; object-fit: cover; flex: 0 0 22px;
  box-sizing: border-box; background: transparent;
}
/* A missing avatar is deliberately a quiet, dotted square—not an invented
   initial or a white tile.  PNG white matte is visually transparent here. */
.aos-avatar-placeholder{
  display: block; border: 1px dotted #666; background: transparent;
}
.aos-avatar-placeholder--large{ width:44px; height:44px; flex-basis:44px; border-color:#000; }
.aos-avatar-png{ mix-blend-mode: normal; background:#fff; opacity:1; }
.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-dr-header{display:flex;align-items:flex-end;justify-content:space-between;border-bottom:2px solid var(--line,#000);padding:6px 12px 0;background:var(--panel,#c0c0c0);gap:12px}
.aos-dr-header .aos-audio-switch,
.aos-dr-header .aos-dr-tabs{display:flex;gap:0;margin:0;padding:0;border-bottom:none}
.aos-dr-header 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;border-bottom:none;cursor:pointer;padding:4px 10px;height:24px;box-sizing:border-box;line-height:1}
.aos-dr-header button.on{background:var(--highlight,#ffffe0) !important;color:#000 !important;font-weight:bold !important;border:2px inset #fff !important;border-bottom:none !important}
.aos-dr-player{display:grid;grid-template-columns:260px 1fr;gap:20px;padding:12px;font:12px "Courier New",monospace;align-items:start;box-sizing:border-box}
.aos-dr-left{min-width:0}
.aos-dr-right{min-width:0;display:flex;flex-direction:column}
.aos-dr-tabbody{max-height:min(34vh,280px);overflow-y:auto;padding:2px 0}
.aos-dr-genres{display:flex;flex-wrap:wrap;gap:5px;max-height:240px;overflow-y:auto;padding:2px 2px 8px 2px}
.aos-dr-genres button{font:10px "Courier New",monospace;background:var(--panel,#c0c0c0);color:var(--fg,#000);border:2px outset #fff;box-shadow: 1px 1px 0 #000;cursor:pointer;padding:3px 8px;white-space:nowrap;height:22px;box-sizing:border-box;line-height:1;display:inline-flex;align-items:center}
.aos-dr-genres button:active,.aos-dr-genres button.on{background:var(--highlight,#ffffe0) !important;color:#000 !important;font-weight:bold !important;border:2px inset #fff !important;box-shadow: none !important}

/* 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: 10000;
  display: none; gap: 0; flex-wrap: nowrap;
  width: 100% !important; min-width: 100% !important;
  background: #c0c0c0 !important; color: #000000 !important;
  border-bottom: 1px solid #000 !important;
  padding: 0; font: 10px "Courier New", monospace;
  box-sizing: border-box !important;
  align-items: stretch;
  overflow: visible !important;
}
#aos-topchips * {
  color: #000000 !important;
}
body.aos-top-open #aos-topchips{ display: flex !important; }
.aos-controls-group {
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding-right: 6px !important;
  flex-shrink: 0 !important;
}
.aos-chips-group {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}
.aos-search{display:flex;align-items:center;gap:5px;flex:0 1 280px;max-width:340px;min-width:140px;margin:3px 8px;border:1px solid #808080;background:#fff !important;color:#000 !important;padding:1px 6px}
.aos-search-scope{flex:0 0 auto;background:#d4d0c8 !important;color:#000 !important;border:1px solid #999;padding:2px 5px;font:bold 9px "Courier New",monospace;white-space:nowrap}
.aos-search-input{flex:1;min-width:0;border:0!important;outline:0!important;background:#fff!important;color:#000!important;padding:3px 2px!important;font:11px "Courier New",monospace!important;width:auto!important;box-shadow: none!important}
#aos-topchips a{
  padding: 5px 8px; border-right: 1px solid #999; color: #000000 !important;
  text-decoration: none !important; text-transform: uppercase; background: transparent;
}
#aos-topchips a:hover, #aos-topchips a.on{ background: #000000 !important; color: #ffffff !important; }
#aos-topchips a:hover *, #aos-topchips a.on *{ color: #ffffff !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;
}

/* User dropdown tab in top bar */
.aos-user-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.aos-user-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 6px 2px 3px !important;
  font: 11px "Courier New", Courier, monospace !important;
  text-decoration: none !important;
  border: 2px outset #ffffff !important;
  background: #c0c0c0 !important;
  box-shadow: 1px 1px 0 #000 !important;
  cursor: pointer;
  color: #000000 !important;
  height: 20px;
  box-sizing: border-box;
}
.aos-user-btn:active, .aos-user-btn.open {
  border: 2px inset #ffffff !important;
  background: #d4d0c8 !important;
  box-shadow: 4px 4px 0 #000
}
.aos-user-btn .aos-user-pfp {
  width: 14px;
  height: 14px;
  object-fit: cover;
  border: 1px solid #000;
  background: #fff !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  display: inline-block;
  vertical-align: middle;
}
.aos-user-btn .aos-user-pfp-ph {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
  background: #fff;
  font-size: 8px;
  font-weight: bold;
  color: #000;
}
.aos-user-btn .aos-user-caret {
  font-size: 7px;
  margin-left: 1px;
}
.aos-user-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 99999;
  min-width: 180px;
  background: #c0c0c0 !important;
  border: 2px outset #ffffff !important;
  box-shadow: 3px 3px 0 #000 !important;
  display: none;
  padding: 2px 0;
  font-family: "Courier New", Courier, monospace !important;
}
.aos-user-dropdown.open {
  display: block !important;
}
.aos-user-dd-head {
  padding: 4px 8px;
  border-bottom: 1px solid #808080;
  background: #d4d0c8;
  margin-bottom: 2px;
}
.aos-user-dd-name {
  font-weight: bold;
  color: #000000 !important;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aos-user-dd-meta {
  font-size: 10px;
  color: #555555 !important;
}
.aos-user-dd-credits {
  font-size: 10px;
  font-weight: bold;
  color: #008000 !important;
  margin-top: 1px;
}
.aos-user-dropdown a, .aos-user-dropdown button {
  display: flex !important;
  align-items: center;
  gap: 6px;
  padding: 4px 10px !important;
  color: #000000 !important;
  text-decoration: none !important;
  font-family: "Courier New", Courier, monospace !important;
  border: 0 !important;
  background: transparent !important;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  cursor: pointer;
  text-transform: lowercase;
}
.aos-user-dropdown a:hover, .aos-user-dropdown button:hover {
  background: #000080 !important;
  color: #ffffff !important;
}
.aos-user-dropdown a:hover *, .aos-user-dropdown button:hover * {
  color: #ffffff !important;
}
.aos-user-dd-sep {
  height: 1px;
  background: #808080;
  margin: 2px 0;
}

/* 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 4px 0 #000
  }
  #aos-right{ box-shadow: 4px 4px 0 #000 }
  .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}
  .aos-search{order:20;flex-basis:100%;max-width:none;margin:3px 5px}
}

/* 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 #000;
  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:#000!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; }

/* Suppress redundant legacy page navbars across the OS */
nav.nav, .nav, #worldNav, .world-nav, .worldcrumb {
  display: none !important;
}

/* ── TempleOS / HolyC 16-Color EGA/VGA Palette & Integer Grid Primitives ── */
:root {
  --tos-0: #000000;
  --tos-1: #0000aa;
  --tos-2: #00aa00;
  --tos-3: #00aaaa;
  --tos-4: #aa0000;
  --tos-5: #aa00aa;
  --tos-6: #aa5500;
  --tos-7: #aaaaaa;
  --tos-8: #555555;
  --tos-9: #5555ff;
  --tos-10: #55ff55;
  --tos-11: #55ffff;
  --tos-12: #ff5555;
  --tos-13: #ff55ff;
  --tos-14: #ffff55;
  --tos-15: #ffffff;

  --tos-black: var(--tos-0);
  --tos-blue: var(--tos-1);
  --tos-green: var(--tos-2);
  --tos-cyan: var(--tos-3);
  --tos-red: var(--tos-4);
  --tos-magenta: var(--tos-5);
  --tos-brown: var(--tos-6);
  --tos-ltgray: var(--tos-7);
  --tos-dkgray: var(--tos-8);
  --tos-ltblue: var(--tos-9);
  --tos-ltgreen: var(--tos-10);
  --tos-ltcyan: var(--tos-11);
  --tos-ltred: var(--tos-12);
  --tos-ltmagenta: var(--tos-13);
  --tos-yellow: var(--tos-14);
  --tos-white: var(--tos-15);
}

/* 16-Color Utility Classes */
.tos-fg-0 { color: var(--tos-0) !important; }
.tos-fg-1 { color: var(--tos-1) !important; }
.tos-fg-2 { color: var(--tos-2) !important; }
.tos-fg-3 { color: var(--tos-3) !important; }
.tos-fg-4 { color: var(--tos-4) !important; }
.tos-fg-5 { color: var(--tos-5) !important; }
.tos-fg-6 { color: var(--tos-6) !important; }
.tos-fg-7 { color: var(--tos-7) !important; }
.tos-fg-8 { color: var(--tos-8) !important; }
.tos-fg-9 { color: var(--tos-9) !important; }
.tos-fg-10 { color: var(--tos-10) !important; }
.tos-fg-11 { color: var(--tos-11) !important; }
.tos-fg-12 { color: var(--tos-12) !important; }
.tos-fg-13 { color: var(--tos-13) !important; }
.tos-fg-14 { color: var(--tos-14) !important; }
.tos-fg-15 { color: var(--tos-15) !important; }

.tos-bg-0 { background-color: var(--tos-0) !important; }
.tos-bg-1 { background-color: var(--tos-1) !important; }
.tos-bg-2 { background-color: var(--tos-2) !important; }
.tos-bg-3 { background-color: var(--tos-3) !important; }
.tos-bg-4 { background-color: var(--tos-4) !important; }
.tos-bg-5 { background-color: var(--tos-5) !important; }
.tos-bg-6 { background-color: var(--tos-6) !important; }
.tos-bg-7 { background-color: var(--tos-7) !important; }
.tos-bg-8 { background-color: var(--tos-8) !important; }
.tos-bg-9 { background-color: var(--tos-9) !important; }
.tos-bg-10 { background-color: var(--tos-10) !important; }
.tos-bg-11 { background-color: var(--tos-11) !important; }
.tos-bg-12 { background-color: var(--tos-12) !important; }
.tos-bg-13 { background-color: var(--tos-13) !important; }
.tos-bg-14 { background-color: var(--tos-14) !important; }
.tos-bg-15 { background-color: var(--tos-15) !important; }

/* TempleOS Mode / Ankle96 Brutalist Theme */
body.tos-theme,
[data-aos-theme="templeos"] {
  --aos-bg: var(--tos-7);
  --aos-panel: var(--tos-7);
  --aos-ink: var(--tos-0);
  --aos-dim: var(--tos-8);
  font-family: "Courier New", Courier, monospace !important;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

body.tos-theme .aos-panel,
[data-aos-theme="templeos"] .aos-panel {
  border-color: var(--tos-15) var(--tos-0) var(--tos-0) var(--tos-15) !important;
  background: var(--tos-7) !important;
  color: var(--tos-0) !important;
}

body.tos-theme .aos-hd,
[data-aos-theme="templeos"] .aos-hd {
  background: var(--tos-1) !important;
  color: var(--tos-14) !important;
}

/* Integer Grid Math (80x60 character grid / 640x480 viewport) */
.tos-grid-80x60 {
  display: grid;
  grid-template-columns: repeat(80, 8px);
  grid-template-rows: repeat(60, 8px);
  width: 640px;
  height: 480px;
  background: #000000;
  color: var(--tos-14);
  font-family: "Courier New", Courier, monospace;
  font-size: 8px;
  line-height: 8px;
  overflow: hidden;
  image-rendering: pixelated;
}

.tos-viewport-640x480 {
  width: 640px;
  height: 480px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  position: relative;
  background: #000000;
  border: 2px outset #ffffff;
  box-shadow: 2px 2px 0 #000;
  image-rendering: pixelated;
}

/* DolDoc Unified Document Stream */
.tos-doldoc-doc {
  background: #000000;
  color: #ffff55;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.35;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 2px inset #808080;
  box-sizing: border-box;
}

.tos-doldoc-link {
  color: #55ffff !important;
  text-decoration: underline !important;
  cursor: pointer;
  padding: 0 1px;
}
.tos-doldoc-link:hover {
  background: #55ffff !important;
  color: #000000 !important;
}

.tos-doldoc-btn {
  display: inline-block;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  background: #aaaaaa;
  color: #000000;
  border: 2px outset #ffffff;
  cursor: pointer;
  margin: 1px 2px;
  user-select: none;
  vertical-align: middle;
}
.tos-doldoc-btn:active {
  border-style: inset;
  background: #888888;
}

.tos-doldoc-cb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  color: #ffffff;
}
.tos-doldoc-cb input[type="checkbox"] {
  accent-color: #55ff55;
  cursor: pointer;
}

.tos-doldoc-tree {
  margin: 2px 0;
  border-left: 1px dashed #555555;
  padding-left: 8px;
}
.tos-doldoc-tree summary {
  color: #ff55ff;
  cursor: pointer;
  font-weight: bold;
  outline: none;
}
.tos-doldoc-tree summary:hover {
  color: #ffff55;
}
.tos-doldoc-tree[open] > summary {
  color: #55ff55;
}

/* DolDoc Marquee Ticker ($$MA$$) */
.tos-doldoc-marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  box-sizing: border-box;
  background: #0000aa;
  color: #ffff55;
  padding: 2px 4px;
  border: 1px solid #5555ff;
}
.tos-doldoc-marquee-inner {
  display: inline-block;
  padding-left: 100%;
  animation: tosMarquee 12s linear infinite;
}
@keyframes tosMarquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

/* Blinking text ($$BK$$) */
.tos-blink {
  animation: tosBlink 1s steps(1, start) infinite;
}
@keyframes tosBlink {
  50% { opacity: 0; }
}


/* ── THEME: TEMPLEOS / HOLYC ── */
body.theme-temple {
  --bg: #0000aa;
  --fg: #ffffff;
  --panel: #ffffff;
  --line: #ffffff;
  --highlight: #00aaaa;
  --muted: #aaaaaa;
  --faint: #555555;
  --accent: #ffff55;
  --code: #55ff55;
  --link: #ffff55;
  --visited: #ffff55;
  --mono-font: "Courier New", Courier, monospace;
}

body.theme-temple * {
  font-family: var(--mono-font) !important;
  font-smooth: never;
  -webkit-font-smoothing: none;
}

body.theme-temple .ank-dlg-box,
body.theme-temple .panel,
body.theme-temple .card {
  border: 4px double #ffffff !important;
  background: #ffffff !important;
  color: #0000aa !important;
  box-shadow: 4px 4px 0 #000
  border-radius: 0 !important;
}

body.theme-temple .ank-dlg-bar,
body.theme-temple .panel-header {
  background: #0000aa !important;
  color: #ffffff !important;
  border-bottom: 4px double #ffffff !important;
  text-align: center;
  font-weight: bold;
}

body.theme-temple button,
body.theme-temple .btn {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
  outline: 2px solid #000000 !important;
  border-radius: 0 !important;
  text-transform: uppercase;
}

body.theme-temple button:hover,
body.theme-temple .btn:hover {
  background: #000000 !important;
  color: #ffffff !important;
}

body.theme-temple input,
body.theme-temple textarea {
  background: #000000 !important;
  color: #ffff55 !important;
  border: 2px solid #ffffff !important;
  outline: none !important;
}

/* @system default helper chip */
.aos-row[data-helper="1"] .aos-name::after,
.aos-friend[data-helper="1"] .aos-name::after {
  content: " · helper";
  color: #333;
  font-size: 9px;
  font-weight: normal;
}
