/* InnerShift site toolbar: search + dark/light toggle (v20261001) */
:root { --stb-h: 44px; }

html.stb-on body { padding-top: var(--stb-h) !important; }
/* CSS fallback for fixed navs (JS also offsets any fixed/sticky top:0 element) */
html.stb-on body > nav, html.stb-on .module-nav { top: var(--stb-h) !important; }
@media (max-width: 900px) {
  html.stb-on .nav-links { top: calc(60px + var(--stb-h)) !important; }
}

.stb-bar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--stb-h);
  z-index: 10000; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; box-sizing: border-box;
  background: #050507; border-bottom: 1px solid rgba(212,175,55,0.25);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; color: #fff;
}
.stb-bar *, .stb-bar *::before, .stb-bar *::after { box-sizing: border-box; }
.stb-brand { color: #D4AF37 !important; text-decoration: none; font-weight: 600; letter-spacing: .5px; white-space: nowrap; font-size: 13px; }
.stb-search { position: relative; flex: 1 1 auto; max-width: 560px; margin: 0 auto; }
.stb-input {
  width: 100%; height: 30px; padding: 0 12px 0 32px; border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.18); background: #15151d; color: #fff;
  font: inherit; font-size: 14px; outline: none; -webkit-appearance: none; appearance: none;
}
.stb-input::placeholder { color: #8a8697; }
.stb-input:focus { border-color: #D4AF37; box-shadow: 0 0 0 2px rgba(212,175,55,0.25); }
.stb-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #8a8697; pointer-events: none; }
.stb-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: #111118; border: 1px solid rgba(212,175,55,0.3); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); max-height: 70vh; overflow-y: auto; display: none;
}
.stb-results.stb-open { display: block; }
.stb-item { display: block; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-decoration: none; color: #fff; }
.stb-item[aria-selected="true"], .stb-item:hover { background: rgba(212,175,55,0.15); }
.stb-item-t { display: block; font-weight: 600; color: #fff; font-size: 14px; line-height: 1.3; }
.stb-item-d { display: block; color: #a9a5b8; font-size: 12px; line-height: 1.35; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stb-empty { padding: 10px; color: #a9a5b8; font-size: 13px; }
.stb-toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 15px; border: 1px solid rgba(255,255,255,0.18); background: #15151d; color: #fff;
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.stb-toggle:hover, .stb-toggle:focus-visible { border-color: #D4AF37; outline: none; }
.stb-toggle svg { width: 15px; height: 15px; }
.stb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) {
  .stb-bar { padding: 0 8px; gap: 6px; }
  .stb-brand { display: none; }
  .stb-toggle { padding: 0 9px; }
  .stb-toggle-label { display: none; }
  .stb-results { position: fixed; top: calc(var(--stb-h) + 2px); left: 6px; right: 6px; }
}

/* ---------- LIGHT THEME ---------- */
html.theme-light {
  --bg-deep: #ffffff; --bg-surface: #f5f5f7; --bg-card: #ffffff; --bg-elevated: #f5f5f7;
  --bg: #ffffff; --bg-2: #f5f5f7; --bg-3: #ececf0;
  --text-primary: #111111; --text: #111111; --text-secondary: #333333;
  --text-muted: #444444; --text-dim: #666666; --muted: #555555;
  --border-subtle: rgba(0,0,0,0.12); --border: rgba(0,0,0,0.14);
  color-scheme: light;
}
html.theme-light, html.theme-light body { background: #ffffff !important; color: #111111 !important; }
/* JS-applied fixes: hard-coded light text / dark surfaces detected at runtime */
html.theme-light .stb-fx-c { color: #111111 !important; -webkit-text-fill-color: currentColor; }
html.theme-light .stb-fx-b { background: #f5f5f7 !important; }
html.theme-light :is(h1,h2,h3,h4,h5,h6,p,li,label,td,th,span,div,strong,a)[style*="color:#fff" i],
html.theme-light :is(h1,h2,h3,h4,h5,h6,p,li,label,td,th,span,div,strong,a)[style*="color: #fff" i],
html.theme-light :is(h1,h2,h3,h4,h5,h6,p,li,label,td,th,span,div,strong,a)[style*="color:white" i],
html.theme-light :is(h1,h2,h3,h4,h5,h6,p,li,label,td,th,span,div,strong,a)[style*="color: white" i] { color: #111111 !important; }
html.theme-light :is(section,header,footer,main,article,aside,nav,div)[style*="background:#0" i],
html.theme-light :is(section,header,footer,main,article,aside,nav,div)[style*="background: #0" i],
html.theme-light :is(section,header,footer,main,article,aside,nav,div)[style*="background:#1" i],
html.theme-light :is(section,header,footer,main,article,aside,nav,div)[style*="background: #1" i] { background: #f5f5f7 !important; }
html.theme-light body > nav, html.theme-light .module-nav { background: rgba(255,255,255,0.96) !important; border-bottom-color: rgba(0,0,0,0.1) !important; }
html.theme-light nav a:not([class*="btn"]):not([class*="cta"]) { color: #222 !important; }
html.theme-light input:not(.stb-input), html.theme-light textarea, html.theme-light select {
  background-color: #ffffff !important; color: #111111 !important; border-color: rgba(0,0,0,0.2) !important;
}
html.theme-light input::placeholder, html.theme-light textarea::placeholder { color: #777 !important; }
html.theme-light hr { border-color: rgba(0,0,0,0.12); }

/* toolbar itself in light mode */
html.theme-light .stb-bar { background: #ffffff; color: #111; border-bottom-color: rgba(0,0,0,0.12); }
html.theme-light .stb-brand { color: #8a6d12 !important; }
html.theme-light .stb-input, html.theme-light .stb-toggle { background: #f3f3f5; color: #111; border-color: rgba(0,0,0,0.18); }
html.theme-light .stb-input::placeholder { color: #666; }
html.theme-light .stb-results { background: #ffffff; border-color: rgba(0,0,0,0.15); box-shadow: 0 12px 32px rgba(0,0,0,0.15); }
html.theme-light .stb-item, html.theme-light .stb-item-t { color: #111; }
html.theme-light .stb-item-d, html.theme-light .stb-empty { color: #555; }
