/* WolfByte Remedy for Windows: the sidebar and icon-rail shells.
   The HUD bar in index.html is one header for every design. Here it turns
   into the gallery's left sidebar (M1, M6, M8, M9, M10) or icon rail
   (M3, M5); each design file then sets its own widths, brand and items.
   Colors come from theme.js, so every paint and mode applies. */

/* ---------- Sidebar ---------- */
html[data-shell="sidebar"] { --side-w: 212px; --side-pad: 14px; }
html[data-shell="sidebar"] .hud {
  right: auto; bottom: 0; width: var(--side-w); height: auto;
  flex-direction: column; align-items: stretch; padding: 22px var(--side-pad) 16px;
  border-bottom: 0; border-right: 1px solid color-mix(in srgb, var(--line) calc(16% * var(--line-k)), transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--chrome-top) 92%, transparent), color-mix(in srgb, var(--chrome-bottom) 96%, transparent));
}
html[data-shell="sidebar"] .hud::after { display: none; }
html[data-shell="sidebar"] .brand { margin: 0; padding: 0 6px 20px; gap: 11px; }
html[data-shell="sidebar"] .brand .logo { width: 50px; height: 50px; }
html[data-shell="sidebar"] .brand .ver { display: block; font: 500 10px/1 "JetBrains Mono", monospace; color: var(--dim); margin-top: 5px; letter-spacing: .04em; }
html[data-shell="sidebar"] .wm { font-size: 22px; letter-spacing: .1em; }
html[data-shell="sidebar"] .tabs { flex-direction: column; height: auto; gap: 3px; }
html[data-shell="sidebar"] .tab {
  height: 36px; padding: 0 10px; gap: 11px; flex: none;
  font: 600 13px/1 Manrope, sans-serif; letter-spacing: 0; text-transform: none; color: var(--text2);
  clip-path: polygon(0 4px, 4px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 12px 100%, 0 calc(100% - 12px));
}
html[data-shell="sidebar"] .tab .tl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-shell="sidebar"] .tab .ti { display: block; width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-shell="sidebar"] .tab.sec { display: flex; }
html[data-shell="sidebar"] .tab.on {
  color: var(--text); text-shadow: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ember) 20%, transparent), color-mix(in srgb, var(--ember) 3%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) calc(22% * var(--line-k)), transparent);
}
html[data-shell="sidebar"] .tab.on .ti { color: var(--flare); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--ember) calc(70% * var(--glow)), transparent)); }
html[data-shell="sidebar"] .tab .bd { margin-left: auto; padding: 4px 6px; border-radius: 3px 7px 3px 7px; }
html[data-shell="sidebar"] .tsep { display: block; height: 1px; margin: 12px 8px; background: color-mix(in srgb, var(--line) calc(12% * var(--line-k)), transparent); }
html[data-shell="sidebar"] .ind, html[data-shell="sidebar"] .hud .icon-btn, html[data-shell="sidebar"] #scan-btn { display: none; }
html[data-shell="sidebar"] .hud .sp { flex: 1; }
html[data-shell="sidebar"] .sfoot {
  display: block; padding: 12px 8px 0; font: 500 10.5px/1.45 Manrope, sans-serif; color: var(--dim);
}
html[data-shell="sidebar"] .sfoot b { display: block; color: var(--text2); font-weight: 700; }
html[data-shell="sidebar"] .page, html[data-shell="rail"] .page { left: var(--side-w); top: 0; bottom: 0; padding: 22px; }
html[data-shell="sidebar"] .footer, html[data-shell="rail"] .footer { display: none; }
html[data-shell="sidebar"] .sweep, html[data-shell="rail"] .sweep { left: var(--side-w); }
html[data-shell="sidebar"] .toast, html[data-shell="rail"] .toast { margin-left: calc(var(--side-w) / 2); }

/* ---------- Icon rail ---------- */
html[data-shell="rail"] { --side-w: 68px; }
html[data-shell="rail"] .hud {
  right: auto; bottom: 0; width: var(--side-w); height: auto;
  flex-direction: column; align-items: center; padding: 22px 0 14px; gap: 6px;
  border-bottom: 0; border-right: 1px solid color-mix(in srgb, var(--line) calc(14% * var(--line-k)), transparent);
  background: linear-gradient(180deg, var(--chrome-top), var(--ground-deep));
}
html[data-shell="rail"] .hud::after, html[data-shell="rail"] .ind, html[data-shell="rail"] .hud .icon-btn,
html[data-shell="rail"] #scan-btn, html[data-shell="rail"] .bw, html[data-shell="rail"] .tab .tl, html[data-shell="rail"] .tab .bd { display: none; }
html[data-shell="rail"] .brand { margin: 0 0 14px; }
html[data-shell="rail"] .brand .logo { width: 44px; height: 44px; }
html[data-shell="rail"] .tabs { flex-direction: column; height: auto; gap: 6px; flex: 1; align-items: center; }
html[data-shell="rail"] .tab {
  width: 42px; height: 42px; padding: 0; justify-content: center; color: var(--dim); flex: none;
  clip-path: polygon(0 4px, 4px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 12px 100%, 0 calc(100% - 12px));
}
html[data-shell="rail"] .tab:hover { color: var(--text); }
html[data-shell="rail"] .tab .ti { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-shell="rail"] .tab.sec { display: flex; }
html[data-shell="rail"] .tab.on { color: var(--flare); text-shadow: none; background: color-mix(in srgb, var(--ember) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) calc(30% * var(--line-k)), transparent); }
html[data-shell="rail"] .tab.on .ti { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--ember) calc(90% * var(--glow)), transparent)); }
html[data-shell="rail"] .tsep { display: block; flex: 1; }
html[data-shell="rail"] .tsep::after { content: ""; display: block; width: 26px; height: 1px; margin: 0 auto; position: relative; top: calc(100% - 7px); background: color-mix(in srgb, var(--line) calc(15% * var(--line-k)), transparent); }
html[data-shell="rail"] .hud .sp { display: none; }

/* Only some designs have the slow scan band. */
html[data-sweep="off"] .sweep { display: none; }

/* A design's Overview fills the page, like the gallery's 700pt window. */
html:not([data-design="cockpit"]) .ovx { min-height: 100%; display: flex; flex-direction: column; }
html:not([data-design="cockpit"]) .ovx > * { flex: 1; }
html[data-mode="light"][data-shell="sidebar"] .tab.on .ti, html[data-mode="light"][data-shell="rail"] .tab.on { color: var(--ember); }
