/* Ecosystem app switcher — Premium SaaS */

.ecosystem-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--s1, #FFFFFF);
}

.ecosystem-nav--topbar {
  padding: 0;
  min-height: auto;
  border: none;
}

.ecosystem-nav--sticky-mobile {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.eco-back {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-pill);
  background: var(--s1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.eco-back:hover {
  color: var(--text-1);
  border-color: var(--brand-primary);
}

.eco-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--s2, #F5F2EC);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}

.eco-pill {
  min-height: 32px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.eco-pill:hover {
  color: var(--text-1);
}

.eco-pill.is-active {
  background: var(--s1);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

.eco-pill.is-active[data-eco-app="vinar"],
.eco-pill.is-active[data-eco-app="today"] { color: var(--brand-primary); }
.eco-pill.is-active[data-eco-app="chat"] { color: var(--brand-primary); }
.eco-pill.is-active[data-eco-app="chart"] { color: var(--brand-primary); }
.eco-pill.is-active[data-eco-app="vela"] { color: #C45C26; }
.eco-pill.is-active[data-eco-app="wallet"] { color: #0D9488; }

.ecosystem-nav--pills-only {
  padding: 0;
  min-height: auto;
  border: none;
  background: transparent;
}

/* Mobile sticky: eco + subnav stack */
.ecosystem-nav-sticky-wrap {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.ecosystem-nav-sticky-wrap__top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
}

.ecosystem-nav-sticky-wrap__top #ecosystem-nav-mount {
  flex: 1;
  min-width: 0;
}

.ecosystem-nav-sticky-wrap__top #shell-utilities-mount {
  flex-shrink: 0;
}

.ecosystem-nav-sticky-wrap .ecosystem-nav--sticky-mobile {
  position: static;
  box-shadow: none;
  border-bottom: none;
  padding: 0;
  background: transparent;
}

.ecosystem-nav-sticky-wrap .shell-utilities {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.ecosystem-nav-sticky-wrap .shell-util-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--s1);
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}

.ecosystem-nav-sticky-wrap .shell-util-btn:active {
  transform: scale(0.96);
}

.ecosystem-nav-sticky-wrap .shell-util-btn--icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

.ecosystem-nav-sticky-wrap .shell-util-btn--link {
  text-decoration: none;
}

.ecosystem-nav-sticky-wrap .shell-util-btn--lang .shell-util-lang-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ecosystem-nav-sticky-wrap .eco-pills {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.ecosystem-nav-sticky-wrap .eco-pills::-webkit-scrollbar {
  display: none;
}

.ecosystem-nav-sticky-wrap .eco-back {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 11px;
}

.ecosystem-nav-sticky-wrap .eco-pill {
  font-size: 11px;
  padding: 5px 10px;
}

.ecosystem-nav-sticky-wrap .shell-subnav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 0 12px 10px;
  scrollbar-width: none;
}

.ecosystem-nav-sticky-wrap .shell-subnav::-webkit-scrollbar { display: none; }

.ecosystem-nav-sticky-wrap .shell-subnav-item {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.ecosystem-nav-sticky-wrap .shell-subnav-item.is-active {
  background: var(--brand-primary-dim);
  color: var(--brand-primary);
  font-weight: 600;
}

.ecosystem-nav-sticky-wrap .shell-subnav-more-trigger {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  cursor: pointer;
}

.ecosystem-nav-sticky-wrap .shell-subnav-more-trigger.is-active {
  background: var(--brand-primary-dim);
  color: var(--brand-primary);
  font-weight: 600;
}

.ecosystem-nav-sticky-wrap .shell-subnav-overflow-panel {
  position: absolute;
  top: 100%;
  right: 12px;
  z-index: 200;
  min-width: 160px;
  padding: 6px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.ecosystem-nav-sticky-wrap .shell-subnav-overflow-panel .shell-subnav-item {
  display: block;
}

html.vinar-embed .ecosystem-nav,
html.vinar-embed .journey-breadcrumb { display: none !important; }

.journey-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--s1);
  border-bottom: 1px solid var(--border);
}

.journey-breadcrumb button {
  color: var(--text-2);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.journey-breadcrumb button:hover { color: var(--brand-primary); }
.journey-breadcrumb .sep { opacity: 0.4; }

/* Microapp full-page layout */
body[data-app="vela"],
body[data-app="wallet"] {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
}

body[data-app="vela"] .shell,
body[data-app="wallet"] .shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body[data-app="vela"] .tabs,
body[data-app="wallet"] .tabs {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

body[data-app="vela"] .tab-btn,
body[data-app="wallet"] .tab-btn {
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  background: var(--s1);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

body[data-app="vela"] .tab-btn.active {
  background: #FFF4EB;
  border-color: #F0C9A0;
  color: #9A4E12;
}

body[data-app="wallet"] .tab-btn.active {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}

body[data-app="vela"] .frame-wrap,
body[data-app="wallet"] .frame-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: none;
  border-radius: 0;
  background: var(--bg);
}

body[data-app="vela"] .frame,
body[data-app="wallet"] .frame {
  flex: 1;
  width: 100%;
  min-height: 60vh;
  border: 0;
  background: var(--bg);
}

/* microapp-host-pro uses absolute fill — drop legacy min-height */
body.microapp-host[data-app="vela"] .frame,
body.microapp-host[data-app="wallet"] .frame {
  min-height: 0;
}

/* ── Interaction polish — pressed + focus rings ──────────────────────────── */
.eco-back,
.eco-pill {
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}

.eco-back:active,
.eco-pill:active {
  transform: scale(0.96);
}

.eco-back:focus-visible,
.eco-pill:focus-visible,
.journey-breadcrumb button:focus-visible,
body[data-app="vela"] .tab-btn:focus-visible,
body[data-app="wallet"] .tab-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--r-pill);
}

body[data-app="vela"] .tab-btn,
body[data-app="wallet"] .tab-btn {
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}

body[data-app="vela"] .tab-btn:active,
body[data-app="wallet"] .tab-btn:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .eco-back,
  .eco-pill,
  body[data-app="vela"] .tab-btn,
  body[data-app="wallet"] .tab-btn {
    transition: background 0.15s ease, color 0.15s ease;
  }
  .eco-back:active,
  .eco-pill:active,
  body[data-app="vela"] .tab-btn:active,
  body[data-app="wallet"] .tab-btn:active {
    transform: none;
  }
}
