/* ── nav-bar ─────────────────────────────────────────────── */
body.has-nav-sidebar {
  padding-left: 64px;
}
@media (max-width: 680px) {
  body.has-nav-sidebar {
    padding-left: 16px;
    padding-bottom: 68px;
  }
}

.main-nav {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  scrollbar-width: none;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  width: 56px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .07);
  border-left: none;
  border-radius: 0 14px 14px 0;
  box-shadow:
    4px 0 32px rgba(0, 0, 0, .6),
    inset -1px 0 0 rgba(255, 255, 255, .04);
  transition: width .2s cubic-bezier(.4, 0, .2, 1);
}
.main-nav:hover {
  width: 180px;
  overflow-y: auto;
}
.main-nav::-webkit-scrollbar { display: none; }

.main-nav::after {
  content: '';
  position: sticky;
  bottom: 0;
  display: block;
  height: 28px;
  background: linear-gradient(to bottom, transparent, rgba(13, 17, 23, .85));
  pointer-events: none;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #6e7681;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 400;
  padding: 8px 18px 8px 18px;
  border-left: 2px solid transparent;
  white-space: nowrap;
  transition: color .13s, background .13s, border-color .13s;
  position: relative;
}
.nav-link:hover {
  color: #c9d1d9;
  background: rgba(255, 255, 255, .06);
  border-left-color: #30363d;
}
.nav-link.active {
  color: #58a6ff;
  background: rgba(56, 139, 253, .12);
  border-left-color: #388bfd;
  font-weight: 500;
}
.nav-link.active .nav-emoji {
  filter: drop-shadow(0 0 4px rgba(88, 166, 255, .5));
}

.nav-emoji {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: filter .13s;
}

.nav-label {
  opacity: 0;
  transition: opacity .15s .05s;
  pointer-events: none;
}
.main-nav:hover .nav-label {
  opacity: 1;
}

@media (max-width: 680px) {
  .main-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    transform: none;
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
    scrollbar-width: none;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 0;
    background: rgba(13, 17, 23, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, .07);
    border-radius: 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .5);
    transition: none;
  }
  .main-nav:hover {
    width: auto;
    overflow-y: visible;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav::after { display: none; }

  .nav-link {
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 9px 14px 11px;
    gap: 3px;
    border-left: none;
    border-top: 2px solid transparent;
    min-width: 52px;
    font-size: 9.5px;
    letter-spacing: .01em;
  }
  .nav-link:hover {
    border-left-color: transparent;
    border-top-color: #30363d;
  }
  .nav-link.active {
    color: #58a6ff;
    border-left-color: transparent;
    border-top-color: #388bfd;
    background: rgba(56, 139, 253, .08);
  }
  .nav-link.active .nav-emoji {
    filter: drop-shadow(0 0 3px rgba(88, 166, 255, .5));
  }

  .nav-emoji { font-size: 17px; }
  .nav-label { display: none; opacity: 1; }
}

.gs-fab {
  position: fixed;
  bottom: 40px;
  right: 20px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #c9d1d9;
  cursor: pointer;
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .1);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  line-height: 1;
}
.gs-fab-icon { font-size: 16px; line-height: 1; }
.gs-fab-label { font-size: 13px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.gs-fab:hover {
  background: rgba(255, 255, 255, .11);
  border-color: rgba(255, 255, 255, .28);
  color: #e6edf3;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .15);
}
@media (max-width: 680px) {
  .gs-fab {
    bottom: 80px;
    height: 32px;
    padding: 0 10px;
    border-radius: 16px;
    gap: 0;
  }
  .gs-fab-icon { font-size: 15px; }
  .gs-fab-label { display: none; }
}

button.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
}

.gs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.gs-overlay.open { display: flex; }

.gs-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 20px;
  background: #161b22;
  border: 1px solid #388bfd;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .85), 0 0 0 1px rgba(88, 166, 255, .12);
  overflow: hidden;
}
.gs-box input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  outline: none;
  color: #e6edf3;
  font-size: 18px;
  padding: 16px 20px;
  font-family: system-ui, sans-serif;
  letter-spacing: .02em;
}
.gs-box input::placeholder { color: #484f58; }
.gs-box .srch-dd {
  position: relative;
  top: auto;
  border: none;
  border-top: 1px solid #21262d;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* ── search-bar ──────────────────────────────────────────── */
.srch-wrap{position:relative;flex:1;min-width:0}
.srch-dd{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#161b22;border:1px solid #30363d;border-radius:8px;overflow:hidden;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.5);display:none}
.srch-dd.open{display:block}
.srch-item{display:flex;align-items:center;gap:10px;padding:9px 12px;cursor:pointer;transition:background .1s}
.srch-item:hover,.srch-item.active{background:#1f2937}
.srch-sym{font-size:13px;font-weight:700;color:#e6edf3;font-family:monospace;min-width:52px;flex-shrink:0}
.srch-name{font-size:12px;color:#6e7681;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.srch-type{font-size:10px;color:#8b949e;margin-left:auto;flex-shrink:0}

/* ── opex-watcher ────────────────────────────────────────── */
#opex-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px 11px 0;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: opex-in .35s cubic-bezier(.22,1,.36,1) both;
  max-width: calc(100vw - 32px);
  overflow: hidden;
}
#opex-toast.multi {
  gap: 10px;
}
#opex-toast.out {
  animation: opex-out .22s ease forwards;
  pointer-events: none;
}

@keyframes opex-in {
  from { transform: translateX(-50%) translateY(72px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
@keyframes opex-out {
  from { transform: translateX(-50%) translateY(0);  opacity: 1; }
  to   { transform: translateX(-50%) translateY(72px); opacity: 0; }
}

.opex-stripe {
  width: 4px;
  align-self: stretch;
  flex-shrink: 0;
  border-radius: 0;
  margin-right: 2px;
}
.opex-stripe.weekly   { background: #388bfd; }
.opex-stripe.monthly  { background: #f0883e; }
.opex-stripe.witching { background: #f97583; }
.opex-stripe.fomc     { background: #a78bfa; }
.opex-stripe.cpi      { background: #fbbf24; }
.opex-stripe.ppi      { background: #fbbf24; }
.opex-stripe.nfp      { background: #fb923c; }
.opex-stripe.pce      { background: #c084fc; }
.opex-stripe.boj      { background: #f43f5e; }
.opex-stripe.ecb      { background: #38bdf8; }

.opex-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}
.opex-event + .opex-event {
  padding-left: 12px;
  border-left: 1px solid #21262d;
}

.opex-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.opex-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.opex-kind {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8b949e;
  white-space: nowrap;
}
.opex-d {
  font-size: 13px;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: .04em;
  color: #e6edf3;
  white-space: nowrap;
}

.opex-event.weekly  .opex-d { color: #79c0ff; }
.opex-event.monthly .opex-d { color: #f0883e; }
.opex-event.witching .opex-d { color: #f97583; }
.opex-event.fomc    .opex-d { color: #c4b5fd; }
.opex-event.cpi     .opex-d { color: #fcd34d; }
.opex-event.ppi     .opex-d { color: #fcd34d; }
.opex-event.nfp     .opex-d { color: #fdba74; }
.opex-event.pce     .opex-d { color: #d8b4fe; }
.opex-event.boj     .opex-d { color: #fb7185; }
.opex-event.ecb     .opex-d { color: #7dd3fc; }

.opex-more {
  display: inline-flex;
  align-items: center;
  background: #21262d;
  color: #8b949e;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

#opex-toast.has-d0          { border-color: #30363d; animation: opex-in .35s cubic-bezier(.22,1,.36,1) both, toast-border-glow 1.4s ease-in-out infinite; }
#opex-toast.has-d0.weekly   { --glow: rgba(88,166,255,.35); }
#opex-toast.has-d0.monthly  { --glow: rgba(240,136,62,.35); }
#opex-toast.has-d0.witching { --glow: rgba(249,117,131,.45); }
#opex-toast.has-d0.fomc     { --glow: rgba(167,139,250,.40); }
#opex-toast.has-d0.pce      { --glow: rgba(192,132,252,.35); }
#opex-toast.has-d0.boj      { --glow: rgba(244,63,94,.40);  }
#opex-toast.has-d0.ecb      { --glow: rgba(56,189,248,.35); }

@keyframes toast-border-glow {
  0%,100% { box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 0 1px var(--glow,transparent); }
  50%      { box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 16px 2px var(--glow,transparent); }
}

.opex-event.d0 .opex-kind {
  font-weight: 700;
  letter-spacing: .08em;
}
.opex-event.d0 .opex-d {
  font-size: 17px;
  letter-spacing: .06em;
  animation: opex-glow 1.1s ease-in-out infinite;
}
.opex-event.weekly.d0  .opex-d { color: #58a6ff; }
.opex-event.monthly.d0 .opex-d { color: #ff9e4f; }
.opex-event.witching.d0 .opex-d { color: #ff6b7a; font-size: 18px; }

.opex-event.d0 .opex-icon { font-size: 18px; }

@keyframes opex-glow {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

.opex-event.d1 .opex-d    { font-size: 15px; filter: brightness(1.25); animation: opex-glow 2s ease-in-out infinite; }
.opex-event.d1 .opex-icon  { font-size: 17px; }
.opex-event.d1 .opex-kind  { font-weight: 600; }

#opex-toast.has-d1          { animation: opex-in .35s cubic-bezier(.22,1,.36,1) both, border-glow-d1 2s ease-in-out infinite; }
#opex-toast.has-d1.weekly   { --glow-d1: rgba(88,166,255,.18); }
#opex-toast.has-d1.monthly  { --glow-d1: rgba(240,136,62,.18); }
#opex-toast.has-d1.witching { --glow-d1: rgba(249,117,131,.22); }
@keyframes border-glow-d1 {
  0%,100% { box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 0 1px var(--glow-d1,transparent); }
  50%      { box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 10px 1px var(--glow-d1,transparent); }
}

.opex-close {
  font-size: 12px;
  color: #30363d;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 4px 0 8px;
  transition: color .15s;
}
#opex-toast:hover .opex-close { color: #8b949e; }

@media (max-width: 680px) {
  #opex-toast { gap: 8px; padding: 8px 10px 8px 0; bottom: 84px; }
  .opex-event { gap: 6px; padding: 0 2px; }
  .opex-event + .opex-event { padding-left: 8px; }
  .opex-icon { font-size: 13px; }
  .opex-kind { font-size: 9px; letter-spacing: .03em; }
  .opex-d { font-size: 11px; }
  .opex-close { font-size: 10px; padding: 0 2px 0 6px; }
  .opex-stripe { margin-right: 0; }
}

